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 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    pulling auto increment value

    hello.

    I am using this query to put data into my tables. The null value is an auto_incremented column.

    PHP Code:
    $query 'insert into round_info values (null,'.$course_id.',1,'.$gross_score.); 
    Is there a code that allows me to pull the value that it automatically increments without doing another query?

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    Yes, last_insert_id, see this article for information on managing inserts into secondary tables.


  •  

    Posting Permissions

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