Bugfix for obsolet use of mysql_last_insertid.