I'm trying to get the last insert id from a plugin I'm in the process of creating for vBulletin in PHP. For some reason it doesn't seem to be working... Any ideas how I go about it?
- The query is inserting fine using the
$db->query_write($sql_i);
- The documentation I have found states that I need to use
$db->insert_id
Full Code:
$sql_i = "INSERT INTO classifieds_item (".$i_fieldnames.",`date_posted`) values (".$i_values.",NOW())";
$db->query_write($sql_i);
header("location: classifieds.php?class_act=add_img&id=".$db->insert_id);
This is using the standard vBulletin database class.
Any ideas?