Wolfsoap Posted January 25, 2008 Share Posted January 25, 2008 'SELECT date, tags, count(tags) as numberOfTags FROM journal WHERE date BETWEEN "1990-01-01" AND $now GROUP BY tags' This works but doest come back with the right results, i was wondering why. It come backs with the lits of tags and numbers, but it doesn't filter out the dates it should, it just returns every row, regardless of whether the date falls in the criteria or not. Can someone tell me whats up with it please? Link to comment https://forums.phpfreaks.com/topic/87822-solved-uncouth-sql/ Share on other sites More sharing options...
cooldude832 Posted January 25, 2008 Share Posted January 25, 2008 if you are selected the tags just do mysql_num_rows instead of a count. Link to comment https://forums.phpfreaks.com/topic/87822-solved-uncouth-sql/#findComment-449246 Share on other sites More sharing options...
PHP Monkeh Posted January 25, 2008 Share Posted January 25, 2008 And $now is? Link to comment https://forums.phpfreaks.com/topic/87822-solved-uncouth-sql/#findComment-449247 Share on other sites More sharing options...
Wolfsoap Posted January 25, 2008 Author Share Posted January 25, 2008 Im not bothered about the row counting that all works fine, it the date filtering that dosen't. and $now is just the current date in the right format. Link to comment https://forums.phpfreaks.com/topic/87822-solved-uncouth-sql/#findComment-449254 Share on other sites More sharing options...
cooldude832 Posted January 25, 2008 Share Posted January 25, 2008 take your query that php makes to phpmyadmin and see what it outputs there $q = 'SELECT date, tags, count(tags) as numberOfTags FROM journal WHERE date BETWEEN "1990-01-01" AND NOW(); GROUP BY tags' echo "<Br /><br />".$q."<br /><br />"; Link to comment https://forums.phpfreaks.com/topic/87822-solved-uncouth-sql/#findComment-449258 Share on other sites More sharing options...
Wolfsoap Posted January 25, 2008 Author Share Posted January 25, 2008 Neat. That worked. Regards, Cool Dude 832. Link to comment https://forums.phpfreaks.com/topic/87822-solved-uncouth-sql/#findComment-449273 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.