Forum Moderators: coopster
Quick question... Page 1 generates an event which is displayed on page 2.. Page 2 lists the ID which was auto-generated using mysql_insert_id(). How can I code it so the ID is passed to another page through a hyperlink? I was hoping to be able to click a link to add further information, but every attempt at continuing on to the next page by the ID has been unsuccessful..
I tried that :( Here's the code I used (for all I know I may have screwed it up!)
<a href="testing3.php?id='.$row['id'].'">Step 2</a>
also tried
<a href="testing3.php?id='.$id.'">Step 2</a>
and then pulling the id with:
<?PHP
$connect= mysql_connect("localhost","root")
or die("Could not connect to database in localhost!");
$result=mysql_select_db("testdiw")
or die("Could not select that database!");
$sqlquery1 = "SELECT * from diw_alpha";
$id = $_GET['id'];
$query = "SELECT * FROM diw_alpha WHERE id = '$id'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
EDIT***
When I try the hyperlink exactly as you have, I get this in trhe URL:
[localhost...]
but it doesn't echo the id