GniDhal Posted July 6, 2006 Share Posted July 6, 2006 Hello, sorry for my expression, i'm not really english spoken, :blush: My problem : each new order are correctly inserted in te orders table with orders_id autoincrement good. the link tables (orders_products, orders_total...) have a new line so but the orders_id is not transfered, the value of these id is 0. Infact, the new order is not displayed in the admin panel. The same problem is happend when new customer register : address_book table not have customers_id right (value =0). It seem to be a problem about mysql5 because the same scripts and the same DB on PHP4/MySQL4 config run correctly. I identified this : the orders_id is assigned by the tep_db_insert_id() function line 97-99 of checkout_process.php MS2 ver : tep_db_perform(TABLE_ORDERS, $sql_data_array); $insert_id = tep_db_insert_id(); for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $sql_data_array = array('orders_id' => $insert_id, Why this value is comuted to 0 ? :blink: Do you know a solution or the way to solve this problem ? (whithout downgrade the mysql version) Thanks' Link to comment Share on other sites More sharing options...
Guest Posted July 6, 2006 Share Posted July 6, 2006 is this behavior consistent? It may return 0 if you lose the dbase connection in-between. And have you tried it with the default osC code? Also did you install the mySQL 5 yourself? Did you change anything from the default install options? Link to comment Share on other sites More sharing options...
GniDhal Posted July 6, 2006 Author Share Posted July 6, 2006 The code displayed here is the default osC, i think. (last update MS2 11-05) Actually the problem appeared after add one column in the table orders (for customisation) but this column was deleted and the problem persist. No other code was modified. For the installation, it's on my computer with the basic installation of WAMP. It's not really important right now, but i project to change my hosting (actually php4/mysql4) up to php5/mysql5 on new shared web hosting. I would like to fix this problem before. Link to comment Share on other sites More sharing options...
Guest Posted July 6, 2006 Share Posted July 6, 2006 then there should be no problem. One thing you could do is check the mysql status with phpmyadmin and restart mysql in case there are some left-overs with the extra column you made earlier and temp tables. Link to comment Share on other sites More sharing options...
GniDhal Posted July 6, 2006 Author Share Posted July 6, 2006 It may return 0 if you lose the dbase connection in-between. YESSS! :) Thank's for your help. This sentence help me to think... in configure.php define('USE_PCONNECT', 'false'); // use persistent connections? seems to be the fix of this problem. All is working well now. (i hope) Thanks again. Link to comment Share on other sites More sharing options...
GniDhal Posted July 6, 2006 Author Share Posted July 6, 2006 However it exists a bug report about likely problem : http://www.oscommerce.com/community/bugs,3...mysql_insert_id Regards Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.