Query mislukt, 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 'to == '1'' at line 1
En dit is het stukje script:
$mysql_get_messages = mysql_query("SELECT * FROM pm WHERE to = '".$user_id."'") or die ("<br>Query mislukt, error: ".mysql_error());
mysql_query("UPDATE pm SET read = '1' WHERE naar = '".$user_id."' AND id = '".$message_id."'") or die ("query mislukt, error: ". mysql_error());
Error:
query mislukt, 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 'read = '1' WHERE naar = '1' AND id = '1'' at line 1
query mislukt, 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 'read = 1 WHERE naar = 1 AND id = 1' at line 1
<?php
mysql_query("UPDATE pm SET read = '1' WHERE naar = $user_id AND id = $message_id ") or die ("query mislukt, error: ". mysql_error());
?>
Probeer dit eens: