Hello,
I'm trying to build a small project; and as part of it - I want users to search and when presented with relevant enteries in the SQL database - they should be able to click and retrieve a page dedicated to that entity.
The problem I am having is in passing the 'id' of the search result onto the next (description) page.
$SQL = "SELECT * FROM loads";
$result = mysql_query($SQL);
while ($db_field = mysql_fetch_assoc($result)) {
$clickid = $_GET['id'];
print $db_field['id'] ."<a href=\"load_info.php?id=$id"
. $id . "\" target=\"_self\" title=\"\">More Info</a>;";
print $db_field['depart:'] . "<BR>";
print $db_field['dest'] . "<BR>";
}
I thought it was easy enough to pass the variable like above ("load_info.php?id=$id) and then grab it on the next page like so:
$val = $_GET['clickid'];
Unfortunately, it doesn't retrieve the info from the page before. If I insert a number in there, it does work correctly, but I really need the ID of the database entry to pass on so as to provide the user with further information.
If anyone could help it would be appreciated.
L.