chiragforever has asked for the wisdom of the Perl Monks concerning the following question:
I am using DBI(1.54) perl module to update the mysql database,i am using "last_insert_id" to get the last inseted value,but it is giving me "null" value.
Intresting thing here is ,it is system specific.On some system("linux") it is working fine.I think it has something to do with DBI version or drives,but could not find the solution.
What i am doing:
---------------
1)Inserting a row in table.
2)And trynig to get last inseted idmy $tmp_query="insert into <TableName> values('','');"; $sth = $dbh->prepare($tmp_query); $sth->execute(); $sth->finish();
"$out" value is null.my $out = $dbh->last_insert_id(undef, undef, "<Table Name>", undef);
Please help me out if you have any information on this.
Regards,
Chirag
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting null value from last_insert_id()
by ferreira (Chaplain) on Apr 05, 2007 at 11:09 UTC | |
|
Re: Getting null value from last_insert_id()
by Krambambuli (Curate) on Apr 05, 2007 at 11:35 UTC | |
|
Re: Getting null value from last_insert_id()
by robot_tourist (Hermit) on Apr 05, 2007 at 12:08 UTC | |
by chiragforever (Novice) on Apr 10, 2007 at 06:28 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |