seidanis Posted January 20, 2003 Share Posted January 20, 2003 Here\'s the story: I need to look up entries from a table that fulfil the following criteria: banner=\\\"top\\\" [\\\"banner\\\" field is set(\'top\',\'bottom\')]start<=date(\'U\') [\\\"start\\\" field is a unix timestamp] end>=date(\'U\') [\\\"end\\\" field is a unix timestamp] However, the following query does not seem to work: \"SELECT * FROM table WHERE banner=\'top\' AND start<=\'$datenow\' AND end>=\'$datenow\'\" where $datenow=date(\'U\'). If I remove the second AND clause, it works OK. The question is: how do I look up entries in my table that fulfil the above 3 criteria? Any help would be highly appreciated. Alex Link to comment https://forums.phpfreaks.com/topic/68-searching-a-mysql-table-using-multiple-criteria/ Share on other sites More sharing options...
seidanis Posted January 20, 2003 Author Share Posted January 20, 2003 OK, I got it. I had a tiny typo in the query: end=>\'$datenow\' Link to comment https://forums.phpfreaks.com/topic/68-searching-a-mysql-table-using-multiple-criteria/#findComment-185 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.