Jump to content

query help


corillo181

Recommended Posts

[code]

<?php
include'../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

this did the trick

[code]

<?php
include'../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

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.