William R. Mussatto wrote on 29.06.2004:
Jan Eden said:
But how can I get the id (INT PRIMARY KEY AUTO_INCREMENT)
immediately after inserting new data? Is there a good way to return
such a value upon insertion?
add following line into else clause after do.
($id)=$dbh->selectrow_array("SELECT LAST_INSERT_ID()"); BTW:
equivalent construct will work for java.
Thanks, William and Mayuran,
that did the trick. I suspected there is a function for such an obvious
necessity, but I got lost in all the manuals around me.
- Jan