kts Posted July 23, 2009 Share Posted July 23, 2009 My select statement: select DATE_FORMAT(affiliate_date,'%m/%d/%y') as afdate from affiliate_sales WHERE afdate >= '2009/6/23 00:00:00' AND afdate<= '2009/7/23 23:59:59' Works when used in phpmyadmin, but when processed by the form, says there are no results..... Any ideas? Link to comment https://forums.phpfreaks.com/topic/167176-problem-with-selecting-between-two-dates/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 23, 2009 Share Posted July 23, 2009 The only way it would work is if the WHERE clause is - WHERE affiliate_date >= '2009/6/23 00:00:00' AND affiliate_date <= '2009/7/23 23:59:59' Link to comment https://forums.phpfreaks.com/topic/167176-problem-with-selecting-between-two-dates/#findComment-881471 Share on other sites More sharing options...
ldougherty Posted July 23, 2009 Share Posted July 23, 2009 Obviously when you run it through phpmyadmin you replace the variables with actual values and this is when it works. Therefore the problem must be with the value of the variables in the query on your script. Try echoing out the variables prior to running the query to see if they have the values you expect. Link to comment https://forums.phpfreaks.com/topic/167176-problem-with-selecting-between-two-dates/#findComment-881475 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.