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.

PHP/SQL: Problem mit Update-Befehl

Empfohlene Antworten

Hi,

hab mal wieder nen Problem. Es funktioniert eigentlich alles, außer das updaten des Datums. Die Anzahl wird noch geändert. Er schreibt mir, dass ich einen Fehler in meiner SQL-Syntax hätte. Kann mir da einer helfen?

Schon mal Danke!

LG

Sebastian

$datum = date("Y-m-d");

$zeit = date("H:i:s");

$zusammen = $datum." ".$zeit;


$insert = "INSERT INTO `basti-wehr_forum-beitraege` (themenid,text,autor,datum) VALUES ('$id', '$_POST[text]', '$_POST[name]', '$zusammen')";

mysql_query($insert) or die(mysql_error());


$update = "UPDATE `basti-wehr_forum-themen` SET anzahl=(anzahl + 1), datum=$zusammen WHERE id=$id";

mysql_query($update) or die(mysql_error());

Probier mal:

$zusammen = date("Y-m-d H:i:s");

$update = "UPDATE basti-wehr_forum-themen SET anzahl=(anzahl + 1), datum='$zusammen' WHERE id='$id'";
mysql_query($update) or die(mysql_error());[/PHP]

Hi,

danke für deine schnelle Antwort.

Hatte ich leider auch schon probiert. Habs zwar jetzt nochmal so gemacht.

Will aber trotzdem nicht....!

LG

Sebastian

Ok, dann halt so:

$update = "UPDATE basti-wehr_forum-themen SET anzahl=(anzahl + 1), datum='".$zusammen."' WHERE id='".$id."'"; 
mysql_query($update) or die(mysql_error());[/PHP]

Poste mal die komplette Fehlermeldung.

Nicht ganz...aber so gehts:

 $update = "UPDATE `basti-wehr_forum-themen` SET anzahl=(anzahl + 1), datum='".$zusammen."' WHERE id='".$id."'";

mysql_query($update) or die(mysql_error());

Danke...;)!

LG

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

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.