Paul McNeil wrote:

last_insert_id() should work. You are updating using @bind_values. What is
the text of that? Does it indeed create a record?


@bind_values is an array of values that gets populated from my form.
It has the same number of elements as the number of placeholders in my SQL, and yes, the record is created, and I see the 'insert into' statement appear immediately in the query log.


Perl's DBI is supposed to then allow me to use the 'last_insert_id()' function of the database handle:

my $inserted_id = $dbh->last_insert_id();

to get the value into $inserted_id. But it doesn't work. I haven't yet tried doing a 'select last_insert_id()' or 'select @@identity' statement, but I suppose I can fall back to that. I was just wondering if I was doing something wrong, but the more I look at it ( and it's a pretty simple script ) the more I think there's something up with DBI.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to