carry a link to next page

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
nutstretch
Forum Contributor
Posts: 104
Joined: Sun Jan 11, 2004 11:46 am
Location: Leicester

carry a link to next page

Post by nutstretch »

I have a page which generates results from a search. I have put a link to a form on the image in the result which I want to link to another page which holds more information about the product.

I don't want to create hundreds of pages so will generate the page in php. how can I carry across the id number of the of the image of the one clicked on so that my next query uses that refernece to generate the page. my code at present is
code:

while ($row = mysql_fetch_array($resultID, MYSQL_ASSOC))
{
$style = $row['StyleID'];
$test = "gifs/".$row['StyleID'].".jpg";

print "<tr>";
//print "<td><img src='$test'></td>";
print "<td><a href = 'search.php'><img src='$test'></a></td>";
print "<td>".$row['StyleID']."</td>";
print "<td>".$row['ProductGroupName']."</td>";
print "<td>".$row['Gender']."</td>";
print "<td>".$row['SubBrand']."</td>";
print "<td>".$row['Colour']."</td>";
print "</tr>";
print "<tr>";
print "<td>";
$resultID1= mysql_query("SELECT * FROM tblFeatureDetails WHERE SytleID LIKE '$style'", $linkID) or die(mysql_error());
while ($row2 = mysql_fetch_row($resultID1, MYSQL_ASSOC))


{
$feature = "gifs/F".$row2['FeatureID'].".png";
print "<img src='$feature'>";
}

}
print"</table>";

end code:
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Just add the id to the link:

<a href="search.php?id=$my_id_number_to_be_passed">my link</a>
Post Reply