Hi,
you have to specify what columns of the table you want to insert values into. So you have to do something like:
my $sql = "INSERT INTO table (col2, col3, col4, col5, col6, col7, col8 +) VALUES (?,?,?,?,?,?,?)";
where colX are the names of the columns to insert into. I assumed that the first column is the autoincrement column. You have to take the real column names.
Without specifying the column names I would guess that the driver is going from left to right in the column definition of the table trying to bind the first variable to the autoincrement column.
My advice: Do always specify the column names. It's more robust against some kind of table layout changes.
McA
In reply to Re: Binding values to table with autoincrement ID
by McA
in thread Binding values to table with autoincrement ID
by sowais
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |