stevesimo Posted March 23, 2007 Share Posted March 23, 2007 Hi I wish to retrieve records from a table called order where orderDate contains the text 'LEX' and the order date is greater than or equal to startDate and also the order date is less than or equal to endDate i.e. Select * from orders where orderDate >=startDate AND orderDate <=endDate AND policyRef contains 'Lex' Order by orderDate I am not sure how to write this in PHP, can anyone offer any advice on how I do this? Many thanks, Steve (Blackpool) Link to comment https://forums.phpfreaks.com/topic/43955-help-with-sql-statement/ Share on other sites More sharing options...
tauchai83 Posted March 23, 2007 Share Posted March 23, 2007 <?php $sql= "SELECT * FROM orders WHERE orderDate BETWEEN startDate AND endDate AND policyRef= 'Lex' ORDER BY orderDate"; $result=mysql_query($sql); ?> try this and see. Link to comment https://forums.phpfreaks.com/topic/43955-help-with-sql-statement/#findComment-213397 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.