Guest Posted February 26, 2007 Share Posted February 26, 2007 Has anybody any ideas regarding the following error: Warning: mysql_insert_id() [function.mysql-insert-id]: A link to the server could not be established in /home/littlebi/public_html/catalog/includes/functions/database.php on line 111 This occurs in the checkout confirmation process. Quote Link to comment Share on other sites More sharing options...
photofxplus Posted February 26, 2007 Share Posted February 26, 2007 (edited) Has anybody any ideas regarding the following error: Warning: mysql_insert_id() [function.mysql-insert-id]: A link to the server could not be established in /home/littlebi/public_html/catalog/includes/functions/database.php on line 111 This occurs in the checkout confirmation process. The function mysql_insert_id returns the last id number of an inserted row in the database table if the table includes an auto-increment column. This would be the value returned. When checking out the osC store inserts a new order_id into the orders table then recalls this value with this function to identify the order. You may want to take a look at the page checkout_process.php to see where this occurs. tep_db_perform(TABLE_ORDERS, $sql_data_array); $insert_id = tep_db_insert_id(); What I do not understand with your error, is the part where it states a link to the server could not be established. This is accomplished in the application_top page and should be a done deal (and is if you are looking at any pages!). Unless the link is referring to the new order id that is not getting inserted. You might try monitering your database as you walk through a purchase and see if the data is added to the orders table. Dont forget to refresh the database page as you walk thru. You can also write some debug code to test the database connection. Put it on the checkout_confirmation page and run it through. Something like: $o_id = $query = tep_db_query("select orders_id, customers_name from " . TABLE_ORDERS where o.orders_id = '" . (int)$o_id . "'"; $data = tep_db_fetch_array($query); print("orders id = " . $data['orders_id'] . " customers name = " . $data['customers_name'] . "<br>"); Edited February 26, 2007 by photofxplus Quote Lloyd Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.