i have to run 2 queries for inserting 2 different tables

userorder table contains orderid , title

order_details containts orderid, qty

so how can i get orderid for my order_details? the code below donts seems able to get last orderid

$query = mysql_query("SELECT last_insert_id()");


You can use mysql_insert_id() function after your insert query.

i got this error, is it the right way to use insert_id() ?

Fatal error: Call to undefined method MySQL::insert_id() in D:\xampp\htdocs\book\checkout-process.php on line 40

$oid = $db->insert_id();