$db = DBI->connect('DBI:mysql:hardware','hardware','1234567890');
my $sth = $db->prepare(qq{
INSERT INTO computer ( inventory_number,person_in_charge,guarantee )
VALUES ( ?, ? ,?)
});
$sth->execute( $inventory_number, $person_in_charge, $guarantee );
$sth = $db->prepare(qq{last_insert_id()});
$sth->execute();
$auto_increment = $sth->fetchrow_array;
$sth->finish;
$db->disconnect;
Переменная $auto_increment пуста, а я ожидаю, найти там последнее сгенерированное значение auto_increment'a. Пожалуйста подскажите, где ошибка
|