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.
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    New Coder
    Join Date
    Dec 2011
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Sorry finger fault local, in my code is $conn->insert_id not $insert_id.

    But I am still getting the number is: 0.

  2. #17
    New Coder
    Join Date
    Dec 2011
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Ok I finally got it sorted!

    What I was doing wrong was redirecting to a "success page" after the insert and the trying to run the mysqi_insert_id($conn) or $conn->insert_id.

    That function won't run after another command has been run (the redirect in this case).

    Fixed it by getting rid of the separate page, incorporating the code in to the processDetails.php page and then did a happy dance.

    Thank Fou-Lu for the nudge in the right direction.


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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