Jump to content

Query not returning any results


php_beginner_83

Recommended Posts

Hi All

 

I have some code that I'm trying to retrieve info from a database.  When I run the query in phpmyadmin the correct records are returned, however, when I used it in my php code it returns nothing.  Does anyone have any idea what's going wrong.

 

This is my code..

 

$result2 = mysql_query("SELECT pictures.ID, pictures.Path FROM pictures 
	 INNER JOIN pics_in_albums 
	 ON pictures.ID = pics_in_albums.PicID 
	 INNER JOIN albums 
	 ON pics_in_albums.AlbumID = albums.ID 
	 WHERE albums.DateAdded <= '2009-10-01' AND pictures.DateAdded >= '2009-10-01'") or die(mysql_error());
...
...
while($row2 = mysql_fetch_assoc($result2))
{
$pic[$count] = $row2['pictures.Path'];
$count++;
}

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/180082-query-not-returning-any-results/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.