PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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!!!
Can you post some generated HTML? What I mean is run the PHP page and do a view source, then post that source that shows the code above already parsed.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
This is the code that shows if I have images in the OtherPictures Table
[syntax="html"]<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Fish Description</title>
<link href="../MainStyles.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<SCRIPT LANGUAGE="JavaScript"><!--
function show(name,src) {
if (document.images)
document.images[name].src = src;
}
//--></SCRIPT>
</head>
<body>
<img src="images/FishPicID/Guppy01.jpg" NAME="myimagename" width="196" height="135"><table border="0">
<tr>
<td><A HREF="javascript:show('myimagename','images/FishPicID/Guppy01.jpg')"><img src="images/FishPicID/Guppy01.jpg" width="60" height="41" border="0"></a></td>
</tr>
<tr>
<td><A HREF="javascript:show('myimagename','images/FishPicID/Guppy02.jpg')"><img src="images/FishPicID/Guppy02.jpg" width="60" height="41" border="0"></a></td>
</tr>
<tr>
<td><A HREF="javascript&:show('myimagename','images/FishPicID/Guppy03.jpg')"><img src="images/FishPicID/Guppy03.jpg" width="60" height="41" border="0"></a></td>
</tr>
</table></body>
</html>
And This is the code if the Fish ID doesn't hav OtherPictures in the table
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]