hi guys,
this forum have helped me alot especially the last thread i posted, , thanks to you if you are reading this and a friend of mine who knows himself.
i have this code which calls out all every image_id from a table using fetch_assoc/fetch_array. what i want to do is that there are some fields which do not have image in them and they null and i want to write a statement which will call the ones with no images and assigned a constant image for them while the ones with images show...
NOW: every image as a link to a page where it shows everything about the picture table and the JOIN table which has full information about the user but the code i wrote won't do that instead, shows the ones with images along with the right links but others a constant image with no link at all
here is my code which pulls out the whole thing.
PHP Code:
$getpic = mysql_query("SELECT * FROM images WHERE ID = '$id'")
or die(mysql_error());
$rows = mysql_fetch_assoc($getpic);
$id = $rows['ID'];
//extract($rows);<this was used to call out any field name that is
//present in image table...
$gotpicid = "imagev/" . $id . ".jpg";
if (!$rows) {
echo("<div class='red'>Image could not be found</div>");
echo("<tr><td width='90' rowspan='5' valign='top'><a href=javascript:Start('info_show.php?usmotors=$id&$vin&$randnum'); class='cursorBut'>" .
"<img src='imagev/no_image.jpg' alt='$model, $year Series: Click to view' width='100' height='90' border='0'></a></td>");
} else {
echo("<tr><td width='90' rowspan='5' valign='top'><a href=javascript:Start('info_show.php?usmotors=$id&$vin&$randnum'); class='cursorBut'>" .
"<img src='$gotpicid' alt='$model, $year Series: Click to view' width='100' height='90' border='0'></a></td>");
}
echo("<td height='21' align='left' valign='top'>Make: $vmake</td>");
echo("<td align='left' valign='top'>Model: $model</td>");
echo("<tr><td height='21' align='left' valign='top'>Type: $cname</td>" .
"<td align='left' valign='top'>Year: $year </td></tr>");
echo("<tr><td height='21' align='left' valign='top'>Price: $$price</td>" .
"<td align='left' valign='top'>Mileage: $mileage</td></tr>");
echo("<tr><td height='21' rowspan='6' align='left' valign='top'>URL:
<a href=javascript:Start('info_show.php?usmotors=$id&$vin&$randnum');>$vmake</a>" .
"</td></tr>");
echo("<tr><td height='30' rowspan='6' align='left' valign='top' nowrap>Note: $note </td>
</tr>");
echo("</table>");
}
Bookmarks