0

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()");

list($oid)=mysql_fetch_row($query);
2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by issaru07
0

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();
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.