Hi,
I have a subroutine which updates and inserts edited/new rows into my database.
Afterwards, I want it to display the edited/new row. This is easy in case of an
edited row, since I have an id to refer to:
if ($id) { $dbh->do("UPDATE items $set_clause WHERE item_id = $id"); }
else { $dbh->do("INSERT INTO items $set_clause"); }
print
$q->redirect("media.pl?mode=get_changed&id=$id&media_type=$media_type");
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?
Thanks,
Jan