Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Pesky Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource


vizflair

Recommended Posts

When adding items to the cart I keep getting: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in */includes/functions/database.php on line 99.

I have checked the forums and this one eludes me. I looked at the instructions for dimensions.txt and split_products_instructions.txt

 

Things were working somewhat normal when I went to edit a product and discovered that I needed to do mods in the above referenced files.

Link to comment
Share on other sites

When adding items to the cart I keep getting: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in */includes/functions/database.php on line 99.

I have checked the forums and this one eludes me. I looked at the instructions for dimensions.txt and split_products_instructions.txt

 

Things were working somewhat normal when I went to edit a product and discovered that I needed to do mods in the above referenced files.

 

That means there is a syntax error in the sql command in that line. Check carefully for typos/editing mistakes. Or download the source again and replace that one line from the original file again.

 

(I dont use this contrib, and havent looked at the files, this advice is just general for that error message, I've had it several times)

Link to comment
Share on other sites

That means there is a syntax error in the sql command in that line. Check carefully for typos/editing mistakes. Or download the source again and replace that one line from the original file again.

 

(I dont use this contrib, and havent looked at the files, this advice is just general for that error message, I've had it several times)

 

Line 98-99 has the following:

 

function tep_db_fetch_array($db_query) {

return mysql_fetch_array($db_query, MYSQL_ASSOC);

}

Link to comment
Share on other sites

Okay, the variable MYSQL_ASSOC is defined somewhere else. Search the included php files for MYSQL_ASSOC and see what it looks like.

On a Unix based server, use: "grep -r MYSQL_ASSOC *.php"

I found it in estore\admin\includes\functions\database.php and estore\includes\functions\database.php

Edited by vizflair
Link to comment
Share on other sites

I found it in estore\admin\includes\functions\database.php and estore\includes\functions\database.php

 

Please post the line! (not the one in the admin directory)

And if it contains further VARIABLES, find those and post those too... you need to follow the complete chain. Sometimes through 4 or 5 different files.

Link to comment
Share on other sites

Please post the line! (not the one in the admin directory)

And if it contains further VARIABLES, find those and post those too... you need to follow the complete chain. Sometimes through 4 or 5 different files.

It is exactly the same...

 

function tep_db_fetch_array($db_query) {

return mysql_fetch_array($db_query, MYSQL_ASSOC);

Link to comment
Share on other sites

  • 2 months later...
And still no code posted.... How are we supposed to help you?

You are right but it would probably not help. The error is caused by not correctly adding a contribution. See for example:

$check_product_query = tep_db_query("select products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$check_product = tep_db_fetch_array($check_product_query);

If you only have the last line ($check_product = tep_db_fetch_array($check_product_query);) you will get that error.

 

So it is caused by sloppy work of the member, not by an error in the the contribution that was added.

Link to comment
Share on other sites

  • 2 weeks later...
You are right but it would probably not help. The error is caused by not correctly adding a contribution. See for example:

$check_product_query = tep_db_query("select products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$check_product = tep_db_fetch_array($check_product_query);

If you only have the last line ($check_product = tep_db_fetch_array($check_product_query);) you will get that error.

 

So it is caused by sloppy work of the member, not by an error in the the contribution that was added.

 

 

You are correct! I installed the contrib with the install instructions instead of overwriting the file.

I used a file compare software and found the problem. I missed a simple '

 

Sorry for the delay in response. I truley appreciate your help, I just got frustrated and gave up a while.

 

I now have over 6 contributions installed and working perfectly thanks to the members here.

I will try my best to do the same on this site as others have.

Link to comment
Share on other sites

  • 3 months later...

I'm having trouble right now with that same error! On the subtotal screen, I get this

 

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /public_html/catalog/includes/functions/database.php on line 99

 

 

Line 98-99 has the following:

 

function tep_db_fetch_array($db_query) {

return mysql_fetch_array($db_query, MYSQL_ASSOC);

}

 

 

and I did not have a type here:

$check_product_query = tep_db_query("select products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

$check_product = tep_db_fetch_array($check_product_query);

 

 

What should i do, please help :( I just installed UPSXML v1.3.5 that's when I have the error

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...