Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

poll/umfrage system

Empfohlene Antworten

Veröffentlicht

ich hab ein poll system, also wenn man auf "vote" klickt,

dann wird folgendes script ausgeführt:

<?

include("mysql.php");

if(!isset($poll_vote)){
header("location: main.php?link=error&error=poll");
} else {
$result = mysql_query("SELECT * FROM polls_answers WHERE ID = '$poll_vote' AND ID_poll ='$poll_id'");
$row = mysql_fetch_array($result);
$votes = $row['votes'];
$max = $votes + 1;
"UPDATE polls_answers SET votes = '$max' WHERE ID_poll = '$poll_id' AND ID = '$poll_vote'";

header("location: main.php?link=home");
}

?>[/PHP]

Es stimmen alle variablen, hab ich vorher mit echo geprüft!

ABER es wird "votes" NICHT up gedated! wieso nicht?

Das feld votes ist INT!

Und meine variablen ($poll_id, $poll_vote) bestehen!

Also sind zb bei poll_ID 3 und bei vote_id 9!

Und es passt auch alles bis aud das, dass er mir dann statt "0" in der zelle der tabelle nicht auf "1" erhöht, sondern es bleibt "0"!

hmmm kann mir da wer helfen?

Danke!

Wenn ich Dich beim kurzen drüberlesen richtig verstanden habe, so willst Du das eine INT Feld einfach um 1 erhöhen.

MySQL kann auch rechnen, also lassen wir es doch die Arbeit für uns machen:

UPDATE tabelle SET feld=feld+1

reicht da vollkommen aus.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.