MySQL-PHP & JavaScript
Posted: Mon Aug 21, 2006 1:10 pm
Hi everyone!!
I was wondering is someone can help me with this code, I'm trying to get the data from MySQL to make a row of other pictures for the same ID, that can show in the big picture (I got the code form http://www.irt.org/script/642.htm) but if I don't have 'FishDescription['Picture'] or FishOtherPictures['OtherFile'] I will like it no to show anything I was trying with IF & ELSE but I couldn't make it happen!!!
Thank you for your help.
I was wondering is someone can help me with this code, I'm trying to get the data from MySQL to make a row of other pictures for the same ID, that can show in the big picture (I got the code form http://www.irt.org/script/642.htm) but if I don't have 'FishDescription['Picture'] or FishOtherPictures['OtherFile'] I will like it no to show anything I was trying with IF & ELSE but I couldn't make it happen!!!
Thank you for your help.
Code: Select all
<SCRIPT LANGUAGE="JavaScript"><!--
function show(name,src) {
if (document.images)
document.images[name].src = src;
}
//--></SCRIPT>
<?php if ($row_FishDescription['Picture'] == NULL)
{
print('<img src="images/FishPicID/blank.jpg" NAME="myimagename" width="196" height="135">'); }
else
{
print('<img src="images/FishPicID/');print($row_FishDescription['Picture']);print('" NAME="myimagename" width="196" height="135">'); }
?>
<table border="0">
<tr>
<td><A HREF="javascript:show('myimagename','images/FishPicID/<?php echo $row_FishDescription['Picture']; ?>')"><img src="images/FishPicID/<?php echo $row_FishDescription['Picture']; ?>" width="60" height="41" border="0"></a></td>
</tr>
<?php do { ?>
<tr>
<td><A HREF="javascript:show('myimagename','images/FishPicID/<?php echo $row_FishOtherPictures['OtherFile']; ?>')"><img src="images/FishPicID/<?php echo $row_FishOtherPictures['OtherFile']; ?>" width="60" height="41" border="0"></a></td>
</tr>
<?php } while ($row_FishOtherPictures = mysql_fetch_assoc($FishOtherPictures)); ?>
</table>