Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2006
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Retrieve Auto incrimented field?

    I have a page where the user inputs a number of field data. The I use some php to make some calculations and upload the results and inputed data into a table. I want to then display the calculated results and the user input and the primary key(that is set to auto incriment). How would I go about doing this to make sure that I return back the right number to match the record that was just created.

  • #2
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    mysql_insert_id() if you're using MySQL with the mysql extension.
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.

  • #3
    Regular Coder
    Join Date
    Nov 2006
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ahhh Sweeet. Thanks. I am a converted VB/C+ coder and the more and more php I use the more and more I like it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •