Jonas Baessens Jonas Baessens - 7 months ago 17
SQL Question

auto Increment starts at maximum value

I set an auto increment at one of my mysql columns like this:

ALTER TABLE i_rapport MODIFY COLUMN rapportID INT auto_increment


but when i submit a form on my webpage, it sets the rapportID as 2147483647

this is my sql;

$sql="INSERT into int_rapport( omschr, status, prioriteit, productnr, versienr,gebruikerID, datum)
VALUES('$omschr','$status','$prioriteit','$productnr','$versienr','$gebruikerID','$datum')";


do i need to put the rapportID in the sql query?

any help would be appreciated !

Answer

You should run this script in order to set your rapportID starts at whatever value you want.

ALTER TABLE i_rapport AUTO_INCREMENT=1;
Comments