Copy link to clipboard
Copied
I am doing an insert form to add a company to my mysql database. On the form, the user enters all the company information. When they submit, I want to go to another form page where they can add their logo. When you use the insert form wizard it ask where you want to go when done. So this line is created
$insertGoTo = "addlogo.php";
I have tried $insertGoTo = "addlogo.php?id" . "=" . $_POST['id'] . ""; , $insertGoTo = "addlogo.php?id" . "=" . $_GET['id'] . ""; $insertGoTo = "addlogo.php?id=" . "=" . $_POST[''id'] . ""; and $insertGoTo = "addlogo.php?id<?php echo $rs_rowsrecordset['id']"";
the addlogo id is a record update page looking at the url for the id. When the url goes it is http://www.mysite.com/addpage.php?id=&
When I put in a number of the ID it does what I want.
The ID is autoincrement from the database.
So, anyone know how I can pass that ID to the addlogo page? Thanks.
Copy link to clipboard
Copied
I'm not certain if lastInsertId() is a pure pdo thing or a php function, (maybe David Powers can help there?), if not pure pdo this function retrieves the id number from the database for you.
The other way is to save your customers name into the session and then insert this into your query.
PZ
Copy link to clipboard
Copied
Hai there. You can try mysql_insert_id() function. Scroll down to the insertion record code where u redirect users after they insert the record, u can see the line "$insertGoTo". At your page name addlogo.php, add like this "addlogo.php?id=" . mysql_insert_id() . ""; .
Find more inspiration, events, and resources on the new Adobe Community
Explore Now