corillo181 Posted November 28, 2006 Share Posted November 28, 2006 [code]<?phpinclude'../includes/db.php';$conn=mysql_query("SELECT photo_id,path FROM tra_test_thumbs")or die(msql_error());$find=mysql_query("SELECT path FROM tra_test_photo WHERE photo_id=$id");while($fbp=mysql_fetch_array($find)&& $fetch=mysql_fetch_array($conn)){?><a href="<?php echo $fbp['path'];?>"><img src="<?php echo $fetch['path'];?>"></a><?php}?>[/code]why isn't this working? Link to comment https://forums.phpfreaks.com/topic/28721-query-help/ Share on other sites More sharing options...
joshi_v Posted November 28, 2006 Share Posted November 28, 2006 May be one of the two queries returning 0 rows!(In while loop you are using && condition.so ) Link to comment https://forums.phpfreaks.com/topic/28721-query-help/#findComment-131515 Share on other sites More sharing options...
corillo181 Posted November 28, 2006 Author Share Posted November 28, 2006 this did the trick[code]<?phpinclude'../includes/db.php';$conn=mysql_query("SELECT photo_id,path FROM tra_test_thumbs")or die(msql_error());while($fetch=mysql_fetch_array($conn)){$id=$fetch['photo_id'];$find=mysql_query("SELECT path FROM tra_test_photo WHERE photo_id=$id");$fbp=mysql_fetch_array($find);?><a href="<?php echo $fbp['path'];?>"><img src="<?php echo $fetch['path'];?>"></a><?php}?>[/code] Link to comment https://forums.phpfreaks.com/topic/28721-query-help/#findComment-131545 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.