Need help on tep_db_insert_id();

by ram07
0 replies
Hi every one,

I am a web developer working on a shopping website (oscommerce). Every thing worked fine till yesterday. But I added a new product to my site. There comes the issue.

The problem is the tep_db_insert_id(); returns 0 instead of returning the last inserted auto incremented value.

Here is the function,
function tep_db_insert_id() {
return mysql_insert_id();
}

For all other products it is working fine, but for this product alone it is not working.

tep_db_perform(TABLE_ORDERS, $sql_data_array);
$insert_id = tep_db_insert_id();

All the fields in the orders table are get inserted and i used this line next to the query.

But when i use this variable in the next order_products, order_total, order_products_attributes tables, the order ID is 0 in all the tables.So i could not view the order in the admin side.

I have searched it in the oscommerce community but i couldn't find a solution. Please any one help me on this.

Thanks.
#tepdbinsertid

Trending Topics