psychohagis Posted January 10, 2007 Share Posted January 10, 2007 I have the following code:[code]$timeout = time() - 1200;$setoffline = "UPDATE users SET online=0 WHERE online=1 AND lasttime='$timeout'";if (!@mysql_query($setoffline)) {echo 'Error: ' . mysql_error();}[/code]and i get the following problem:[quote]Error (set status): 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 '<='1168466894', lastpage='his/her homepage' WHERE id='1'' a [/quote] Link to comment https://forums.phpfreaks.com/topic/33654-sql-less-than-or-equal-to-problem/ Share on other sites More sharing options...
Seamless Posted January 10, 2007 Share Posted January 10, 2007 hi, i'm not an expert but i don't think the error you have quoted relates to the code you are showing. but regarding the error you are showing (correct me if i am wrong) doesn't the less than or equal to have to be like this:=<Seamless. Link to comment https://forums.phpfreaks.com/topic/33654-sql-less-than-or-equal-to-problem/#findComment-157723 Share on other sites More sharing options...
Barand Posted January 10, 2007 Share Posted January 10, 2007 "<= " is fine. I agree about the code not showing the query that the error relates to Link to comment https://forums.phpfreaks.com/topic/33654-sql-less-than-or-equal-to-problem/#findComment-157725 Share on other sites More sharing options...
psychohagis Posted January 10, 2007 Author Share Posted January 10, 2007 oh dont worry i've fixed it now Link to comment https://forums.phpfreaks.com/topic/33654-sql-less-than-or-equal-to-problem/#findComment-157727 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.