-3

I need to update the date and it just don't work, I'm getting sick of this crap! I tryed:

mysqli_query($con, "UPDATE nachrichten SET update = CURDATE() WHERE file = '$msgfile'");
mysqli_query($con, "UPDATE nachrichten SET update = 'CURDATE()' WHERE file = '$msgfile'");
mysqli_query($con, "UPDATE nachrichten SET update = '2014-09-11'  WHERE file = '$msgfile'");
mysqli_query($con, "UPDATE nachrichten SET update = 2014-09-11  WHERE file = '$msgfile'");

And much more NON of this s*** is working whats the problem with that? The field type is date and the connection etc works fine I tested other field updates but only the date BS isn't working it's always 0000-00-00

user3047382
  • 29
  • 1
  • 2
  • 6
  • Guessing is pointless. Try in a direct SQL interface, once you have it sorted, use it. And then add in proper error reporting in the PHP so at least an error message is reported.. (and also, use placeholders as it could very trivially be made to "not work" based on a value of $msgfile that makes the literal invalid) – user2864740 Sep 11 '14 at 01:51
  • Thats not easy because I use AJAX for this PHP file – user3047382 Sep 11 '14 at 01:55
  • It doesn't matter. Guessing is pointless. What *error* occurs? What *values* were used? – user2864740 Sep 11 '14 at 01:56
  • I can't return error report from AJAX, what do you mean by what values? – user3047382 Sep 11 '14 at 01:59

1 Answers1

0

The field update keyword and the SQL keyword UPDATE conflicted here. yes of course you can see the errors from ajax using the firebug mozilla plugin.

This is works for me to separate update keyword from SQL.

mysqli_query($con, "UPDATE nachrichten SET `update` = 2014-09-11  WHERE file = '$msgfile'");
Bira
  • 4,531
  • 2
  • 27
  • 42