0
$qu3 = 'UPDATE logs SET out= '.date("Y-m-d H:i:s").' WHERE sl_no= '.$sno;

  $r4 = mysql_query($qu3)or die(mysql_error());

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out= 2017-07-11 23:04:52 WHERE sl_no= 73' at line 1

chris85
  • 23,846
  • 7
  • 34
  • 51
sachin
  • 1
  • 2
  • 2
    Strings need to be quoted. You shouldn't use `mysql_` anymore... or assuming your mysql and PHP are in the same timezone `out= now() WHERE ` – chris85 Jul 11 '17 at 17:42
  • and/or https://stackoverflow.com/questions/60174/how-can-i-prevent-sql-injection-in-php – chris85 Jul 11 '17 at 17:43
  • Additionally `out` is reserved, https://dev.mysql.com/doc/refman/5.6/en/keywords.html. You need to backtick that. See https://stackoverflow.com/questions/23446377/syntax-error-due-to-using-a-reserved-word-as-a-table-or-column-name-in-mysql – chris85 Jul 11 '17 at 17:46

0 Answers0