Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
mattyboi
Forum Commoner
Posts: 34 Joined: Mon Feb 06, 2006 9:42 pm
Post
by mattyboi » Tue Feb 28, 2006 10:12 am
How do you create a key that auto increments in a table everytime a new record is added using phpMyAdmin?
Thanks
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Feb 28, 2006 10:41 am
Set the field to auto_increment.
mattyboi
Forum Commoner
Posts: 34 Joined: Mon Feb 06, 2006 9:42 pm
Post
by mattyboi » Tue Feb 28, 2006 11:02 am
yeah i did that, but for some reason it is still not working. what do i set the field type as, and the defualt value?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Feb 28, 2006 11:04 am
field type is an INT base, the size only matters in how many records you wish to support without reordering. INT(10) UNSIGNED is the minimum suggested by many. default value doesn't matter. It must be set to PRIMARY.