21.12.2010, 10:29
create a field ( column ) in your table called `ID` or something
if you use phpmyadmin, go to the `index` icon, and create an index on the column
when you have done this, edit the field, under 'extra' you can select 'auto increment'
(note: there is a way to do this with a query, check your SQL syntax guide place )
Now every time you INSERT INTO your table, the row will be assigned a unique ID number, which you can retrieve with
if you use phpmyadmin, go to the `index` icon, and create an index on the column
when you have done this, edit the field, under 'extra' you can select 'auto increment'
(note: there is a way to do this with a query, check your SQL syntax guide place )
Now every time you INSERT INTO your table, the row will be assigned a unique ID number, which you can retrieve with
pawn Код:
mysql_insert_id();