Pi_Mastuh Posted December 15, 2006 Share Posted December 15, 2006 I'm running this query:$SQL = "UPDATE Mail SET read = '1' WHERE msgID = '$msgID'";$result2 = mysql_query($SQL, $connection);but nothing's happening. I try running the query on its own and substituing $msgID with an actualy number, but it says the query is wrong. Any ideas as to what's wrong? Quote Link to comment Share on other sites More sharing options...
Psycho Posted December 15, 2006 Share Posted December 15, 2006 Try adding an error handler to see if anything useful is returned:$result2 = mysql_query($SQL, $connection) or die ("The query:<br>".$sql."<br>Caused the following error:<br>".mysql_error()); Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted December 15, 2006 Share Posted December 15, 2006 have you got a table called mail with the field called read. and the number that your using, is that already in the table. if you are trying to insert then maybe you want INSERT INTO Mail... Quote Link to comment Share on other sites More sharing options...
TEENFRONT Posted December 15, 2006 Share Posted December 15, 2006 $result2 = mysql_query($SQL, $connection) or die ("The query:".$SQL."Caused the following error:".mysql_error());try that one instead - mjdamato had caps missing on the $SQL in the die() statement Quote Link to comment Share on other sites More sharing options...
Pi_Mastuh Posted December 15, 2006 Author Share Posted December 15, 2006 I'm running a query that when you load the page it changes Read from 0 to 1 if it's 0. And I got the following error:The query: UPDATE Mail SET read = '1' WHERE msgID = '1' Caused the following 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 msgID = '1'' at line 1 Quote Link to comment Share on other sites More sharing options...
TEENFRONT Posted December 15, 2006 Share Posted December 15, 2006 $SQL = "UPDATE `Mail` SET `read` = '1' WHERE `msgID` = '$msgID'";try that for your $SQL Quote Link to comment Share on other sites More sharing options...
Pi_Mastuh Posted December 15, 2006 Author Share Posted December 15, 2006 It works, thank you. Quote Link to comment Share on other sites More sharing options...
TEENFRONT Posted December 15, 2006 Share Posted December 15, 2006 no problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.