dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Auto_increment PHP

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    4

    Exclamation Auto_increment PHP

    I have a form with an auto_inc field. The form on submit creates in the table the tuple - with the auto_inc field. What I then need to do is pull the auto_inc field back into the form for processing as a variable to both be displayed in the form, and additionally saved to another table, all in the one form.

  2. #2
    Join Date
    May 2013
    Posts
    5
    Xayan..U do not need to have Auto increment field in PHP, rather u have a field with AUTO-Increment Type in DB table. Follow the steps below
    1. In ur DB table have a field with attributes - "`serial` mediumint(10) unsigned NOT NULL AUTO_INCREMENT,"
    2. Once the Insert is done and $dbc is ur db connection variable, use $serial = mysqli_insert_id($dbc);
    3. then u can use this $serial.

    Please let me know if it answers ur query

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles