947740 Posted July 28, 2009 Share Posted July 28, 2009 Something is wrong with the syntax of this query, but I don't know what. SELECT * FROM moneyin WHERE Date BETWEEN 1248757200 and 1248757200 AND LName LIKE '%%' AND FName LIKE '%%' Link to comment https://forums.phpfreaks.com/topic/167839-solved-query-syntax/ Share on other sites More sharing options...
Maq Posted July 28, 2009 Share Posted July 28, 2009 You need backticks around `Date`. Temporarily put an or die clause to see what the error is. LIKE '%%' doesn't make any sense, as it will match on anything and everything. You should also put single quotes are your timestamp values. Link to comment https://forums.phpfreaks.com/topic/167839-solved-query-syntax/#findComment-885225 Share on other sites More sharing options...
947740 Posted July 28, 2009 Author Share Posted July 28, 2009 Okay, the query does what it is supposed to, I think, but there is still a syntax error. The error, followed by the query: 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 'BETWEEN '1246597200' and '1248841199' AND LName LIKE '%wood%' OR FName LIKE '%wo' at line 1 SELECT * FROM moneyin WHERE `Date` BETWEEN '1246597200' and '1248841199' AND LName LIKE '%wood%' OR FName LIKE '%wood%' Link to comment https://forums.phpfreaks.com/topic/167839-solved-query-syntax/#findComment-885233 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.