Next primary key value

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: Next primary key value

Post by seandisanti » Fri Apr 26, 2013 8:17 am

When you setup your table, set your primary key field to auto increment. Then when you insert, don't include that field in the fields to be inserted, and it will automatically be given the next available id

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest