Click on Image to view larger

I’m wondering how to keep the the description for the following if I put a hyper link on a picture.

echo “<table cellspacing='5’border=‘0’>”;
echo “


”;
while ($row = mysql_fetch_array($result))
{
extract($row);
  echo "


       <td width='10%'valign='top'><b>ID:$ID</b></td>n
	<td width='30%'>	<img src='/images/$PICS' width='185'height='140'> </td>n
	<td valign='top' width='60%'><b>Model: $CARMODEL </b><br> $DESCRIPTION</td>n
n n Click on picture to view larger n

You could pass the id to the description as part of the link and query the DB with it to get your description again (assumes description is too long just to put into the URL) and redisplay it.

Hi Lig,

I appreciate the reply but I was wondering if I could explain how I would do this ? I’m not the sharpess tool in the shed…

You could pass the id to the description as part of the link
look into the $_GET variable - http://www.php.net/variables.predefined
and query the DB with it to get your description again
If you are using MySQL - see http://www.codewalkers.com in the tutorials/basics section "Creating Dynamic Websites with PHP and MySQL". Skip the parts where it loads in the software and view all the DB interaction parts (insert, delete, update, etc.). If you are not using MySQL you still need to look at the tutorial but you will have to change the mysql function calls to the DB you are using.
(assumes description is too long just to put into the URL)
Again look into the $_GET variable
and redisplay it.
check out echo or print - http://www.php.net/echo
Sponsor our Newsletter | Privacy Policy | Terms of Service