Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal IPN


Guest

Recommended Posts

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.

Link to comment
Share on other sites

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 by photofxplus

Lloyd

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...