php_beginner_83 Posted November 3, 2009 Share Posted November 3, 2009 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 More sharing options...
Gayner Posted November 3, 2009 Share Posted November 3, 2009 Echo it out ,l ol Link to comment https://forums.phpfreaks.com/topic/180082-query-not-returning-any-results/#findComment-950001 Share on other sites More sharing options...
php_beginner_83 Posted November 3, 2009 Author Share Posted November 3, 2009 echo what out? I already echoed out contents of $pic array but it came out blank. Link to comment https://forums.phpfreaks.com/topic/180082-query-not-returning-any-results/#findComment-950011 Share on other sites More sharing options...
Neville1985 Posted November 3, 2009 Share Posted November 3, 2009 echo what out? I already echoed out contents of $pic array but it came out blank. is your $count var active before the while loop? if not, start one up then give it a try. $count = 0; blahblahblah Link to comment https://forums.phpfreaks.com/topic/180082-query-not-returning-any-results/#findComment-950030 Share on other sites More sharing options...
Gayner Posted November 3, 2009 Share Posted November 3, 2009 echo what out? I already echoed out contents of $pic array but it came out blank. echo $pic[$count]; Link to comment https://forums.phpfreaks.com/topic/180082-query-not-returning-any-results/#findComment-950579 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.