Shea Posted May 5, 2008 Share Posted May 5, 2008 Hi! Sorry if this has already been posted, but I can't seem to find it. The query is: SELECT * FROM `posts` WHERE (month='10' AND year='2007') I've run it through PHP MyAdmin and it works perfectly. When I run it though PHP, I've been getting the following error: Unknown column 'month' in 'where clause' I know the column is there. The query is just unable to find it for some reason. Any help would be much appreciated. MySQL version: 5.0.16 Link to comment https://forums.phpfreaks.com/topic/104246-solved-unknown-column-month-in-where-clause/ Share on other sites More sharing options...
dooper3 Posted May 5, 2008 Share Posted May 5, 2008 try removing the brackets Link to comment https://forums.phpfreaks.com/topic/104246-solved-unknown-column-month-in-where-clause/#findComment-533677 Share on other sites More sharing options...
fenway Posted May 5, 2008 Share Posted May 5, 2008 try removing the brackets Um, no. You're likely not connecting to the right host/DB. Link to comment https://forums.phpfreaks.com/topic/104246-solved-unknown-column-month-in-where-clause/#findComment-533741 Share on other sites More sharing options...
Shea Posted May 5, 2008 Author Share Posted May 5, 2008 fenway, that was it! Thank you! It was still hooked up to the old database. Link to comment https://forums.phpfreaks.com/topic/104246-solved-unknown-column-month-in-where-clause/#findComment-533746 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.