suttercain Posted November 26, 2007 Share Posted November 26, 2007 Hello, I have $query = mysql_query("SELECT *, STR_TO_DATE(comics.cover_date,'%m/%d/%Y') as Mydate FROM comics, titleSheet WHERE comics.comic_id ='titleSheet.comic_id' ORDER BY Mydate, comics.issue_number") or die(mysql_error()); $tscount = mysql_num_rows($query); echo $tscount; It echos 0 when it should be 300 and something... any help. Thanks. Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 26, 2007 Share Posted November 26, 2007 your query SELECT *, STR_TO_DATE(comics.cover_date,'%m/%d/%Y') as Mydate FROM comics, titleSheet WHERE comics.comic_id ='titleSheet.comic_id' ORDER BY Mydate, comics.issue_number should be SELECT *, STR_TO_DATE(comics.cover_date,'%m/%d/%Y') as Mydate FROM comics, titleSheet WHERE comics.comic_id =titleSheet.comic_id ORDER BY Mydate, comics.issue_number if you quote titleSheet.comic_id mysql will take it as a string Quote Link to comment Share on other sites More sharing options...
drranch Posted November 26, 2007 Share Posted November 26, 2007 did you run it in MYSQL or are you running it from an html page? when you run it in MYSQL it will tell you where your syntax needs fixing Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.