in reply to How to find the highest number in a mysql table
Might not understand the problem but an auto_increment typically means that you don't need to know the ID for the next insert. You can skip that column (if you have a list of the others) or enter null or even 0.
If you need to know the ID after an insert, use my $last_id = $dbh->{'mysql_insertid'};. This can useful to insert associated data into another table.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to find the highest number in a mysql table
by Anonymous Monk on May 10, 2008 at 01:43 UTC | |
by ysth (Canon) on May 10, 2008 at 02:03 UTC | |
by sulfericacid (Deacon) on May 10, 2008 at 02:42 UTC | |
by pc88mxer (Vicar) on May 10, 2008 at 06:24 UTC | |
by CountZero (Bishop) on May 10, 2008 at 15:55 UTC |