vizflair Posted November 11, 2008 Share Posted November 11, 2008 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. Quote Link to comment Share on other sites More sharing options...
arnolde Posted November 11, 2008 Share Posted November 11, 2008 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) Quote Link to comment Share on other sites More sharing options...
vizflair Posted November 11, 2008 Author Share Posted November 11, 2008 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); } Quote Link to comment Share on other sites More sharing options...
arnolde Posted November 11, 2008 Share Posted November 11, 2008 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" Quote Link to comment Share on other sites More sharing options...
vizflair Posted November 11, 2008 Author Share Posted November 11, 2008 (edited) 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 November 11, 2008 by vizflair Quote Link to comment Share on other sites More sharing options...
vizflair Posted November 11, 2008 Author Share Posted November 11, 2008 I am only seeing this after doing the mods for the dimensions and split_product where I modified the shopping_cart.php. That is where i am seeing that error too, at the bottom of the page near the sub total Quote Link to comment Share on other sites More sharing options...
arnolde Posted November 11, 2008 Share Posted November 11, 2008 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. Quote Link to comment Share on other sites More sharing options...
vizflair Posted November 11, 2008 Author Share Posted November 11, 2008 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); Quote Link to comment Share on other sites More sharing options...
restomusclecar Posted January 22, 2009 Share Posted January 22, 2009 same error message for me but on preview of invoice or packing slip only its weird I dont see the name or address of the name of the lcient on the invoice or packig slip but it emails me the correct info. Its got to be an sql command Quote Link to comment Share on other sites More sharing options...
natrium42 Posted January 22, 2009 Share Posted January 22, 2009 And still no code posted.... How are we supposed to help you? Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted January 22, 2009 Share Posted January 22, 2009 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. Quote Link to comment Share on other sites More sharing options...
restomusclecar Posted February 5, 2009 Share Posted February 5, 2009 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. Quote Link to comment Share on other sites More sharing options...
babielo Posted May 18, 2009 Share Posted May 18, 2009 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 Quote 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.