Jump to content

I think this MySQL is proper Syntax, but not getting any results or errors


suttercain

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.