Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

goto specific record after using insert form

Guest
Jun 04, 2009 Jun 04, 2009

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.

TOPICS
Server side applications
583
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 04, 2009 Jun 04, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 08, 2009 Jun 08, 2009
LATEST

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() . ""; .

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines