Unanswered: Returning Last_Inster_ID to perl Variable
Hey all, Im new to Perl and mysql but I have a problem. I am creating an online form used to collect information from a user. All the data from the fourm is collected and perl populates the data just fine, no problems. However, I want to give the user an account number which is an auto increment value in my database. The column name is acct_id. I am trying to find out what the last auto incremet value is using LAST_INSERT_ID() but i do not know how to assign that value to variable in my perl script. I am using dbi. For example,
$dbh->do("SET '$acctnum'=(LAST_INSERT_ID())"); or
How do I get the value of Last_Insert_ID into a variable in perl?
I have several books and i dont see a deffinate answer.
Note the parentheses around $insertid in the second code snippet. If you don't understand why those are there, you need to go over perldoc perlsyntax or you'll have all kinds of problems with list context.