Hey all,
This is what im trying to do.
step1: User enters data into a form (done)
step2: Enter details into database (done) & redirect to page showing the data just entered so that user can confirm details. (problem)
Here is the code where the problem lies. (the sql to insert isnt shown, but is on the same php page (additem_proc.php) )
For some reason this does not find the listingid from the record that was inserted in the same page. I have tried using different parameters after the WHERE clause but with no luck. The listing id just appears as blank in the next page (additem_confirm.php?listingid=<nothinghere>")
Any obvious problems? or can someone point me in the right direction with requerying inserted data.
Thanks in advance!
This is what im trying to do.
step1: User enters data into a form (done)
step2: Enter details into database (done) & redirect to page showing the data just entered so that user can confirm details. (problem)
Here is the code where the problem lies. (the sql to insert isnt shown, but is on the same php page (additem_proc.php) )
PHP:
$result = mysql_query("SELECT * FROM $tbl_name WHERE listingtitle = $listingtitle"); //Query to find listing id of record just inserted
$row = mysql_fetch_array($result);
$listingid=$row['listingid'];
header( "Location: additem_confirm.php?listingid=$listingid" ); //redirect to the newly uploaded listing
For some reason this does not find the listingid from the record that was inserted in the same page. I have tried using different parameters after the WHERE clause but with no luck. The listing id just appears as blank in the next page (additem_confirm.php?listingid=<nothinghere>")
Any obvious problems? or can someone point me in the right direction with requerying inserted data.
Thanks in advance!