PDA

View Full Version : Is there a php code that for every time a user comes it goes up 1?


DrewM
03-08-2006, 09:34 AM
Well I'm trying to make a link page where my users can add a link it does every thing right except when you save becausethe id is already on use. So can some one tell me a php code that for evry time the user saves it goes up 1.

Lea Verou
03-08-2006, 11:07 AM
I think that if you define a column as "auto_increment" this happens automatically. I'm not sure though...

Xenon
03-08-2006, 11:48 AM
if you store it in the db, yep then just make the id field an autoincrementfield

DrewM
03-08-2006, 06:40 PM
thank you

when I do this it comes with the error:
#1063 - Incorrect column specifier for column 'id'

Vizionz
03-08-2006, 06:59 PM
CREATE TABLE tablename (id int(6) NOT NULL auto_increment,
otherstuff varchar(15) NOT NULL,
youneed varchar(15) NOT NULL,

DrewM
03-08-2006, 07:02 PM
thank you.