Jump to content
vashichino7

MySQL error in Shopping Cart.php

Recommended Posts

Hey Guys, I just noticed when I add an item to the cart then I come to remove the cart making it empty, I see the following error:

 

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /XXXX/public_html/shopping_cart.php on line 236

 

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /XXXX/public_html/shopping_cart.php on line 264

 

What is this from? Any help fixing this? Thank you!

Share this post


Link to post
Share on other sites

It's impossible to say without more to go on. In the least you would need to mention what oscommerce version you are using, assuming the shopping cart file has not been edited, or show the code at those lines, +/- 10 lines.

Share this post


Link to post
Share on other sites

@@Jack_mcs - I do apologize. I am using v.2.3.3 and have edited some checkout options. my website is www.savingshub.com - you can try and add a file and remove it, the error will show.

 

Here are the lines

 

$allow_mod_array = array();

line 236 -while($rec = mysql_fetch_array($query)){

if(empty($allow_mod_array)) $startedempty = true;

$methods_array = array();

$methods_array = explode(';',$rec['payment_methods']);

if(!empty($methods_array)){

foreach($methods_array as $method){

$allow_mod_array[] = $method;

}

}

if($startedempty){

 

 

 

here are the lines for 264:

<?php

line 264: if (mysql_num_rows($query)==0 || in_array('checkout_by_amazon',$allow_mod_array)) {

// AMAZON CODE -> START

require_once("checkout_by_amazon/checkout_by_amazon_util_dao.php");

$utilDao = new UtilDAO();

$utilDao->printButton();

// AMAZON CODE -> END

}

?>

Edited by vashichino7

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×