I know it's depreciated, and not generally good practice. But this command: mysql_insert_id for some reason is returning this weird number. And it never has done before.
I cannot find reference to this number anywhere. For instance, I just inserted a record into id
:2, and it gives me the number 1587.
Where is getting that from?
I've had to resort to reverse-querying the database with the exact values that i've just pulled out of it to get the ID. But this makes no sense.
Edit Sorry if I didnt explain this; but it is just a standard insert statement:
INSERT INTO `job` (`subject`,`deadline`,`status`) VALUES ('$title','3454354','CREATED');
And the autoincrement is on the PK which is called 'id'.
The field id
results in being set to 2
, but mysql_insert_id
returns an odd number.
I ran a table status and it shows the auto_increment to be as expected. I am not inserting anything else in this time. Literraly straight after I insert it I am querying for the last inserted ID.