Hello there. I’m working on a basic ad listings website. I am displaying all the titles of each listing using the mysql_fetch_array command and then echoing the output and creating a link to the full ad page. I then want the script to pull out the full database entry for which ever row/link is clicked on. I tried specifying the id of the row into a session variable but when any of the listings are clicked on it only pulls out info for the last id in the array, not the id of the row that was clicked. This is the code below:
[php]
$query = “SELECT * FROM rooms_wanted”;
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo “
”;
echo “”;
echo $row[‘title’]. " ". $row[‘description’];
echo “”;
echo “
}
[/php]
So what I can’t figure out how to do is how to get ‘full_ad.php’ to display the contents of whichever row of the array was clicked on, i.e. if the first row was clicked on I want to bring up all the columns from that particular row.
Any help very much appreciated, I have spent a long time trying to figure this out to no avail, which is why I have posted this here. Thank you.