ghprosvs Posted August 20, 2017 Posted August 20, 2017 Dear, I'm running this contribution on a test site (xamp) and at localhost/catalog/checkout_shipping.php I receive the below error message: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, object given in C:\xampp\htdocs\*****\catalog\includes\modules\shipping\zones.php on line 185 below is a piece of code in checkout_shipping.php were the error originates (marked in red). Apparently this is some old type of PHP coding and replaced by a new type. BUT I lack the knowledge of PHP to be able to update this piece of coding. Would there be any-one who could help me? Many thanks! Kind regards Gerry // Santosh - Added to select default country if not in listing if ($dest_zone == 0) { $dest_zone = $this->num_zones; // the zone is the lastest zone avalaible } // Santosh - Added to select default country if not in listing if ($dest_zone == 0) { $error = true; // this can no more achieve since by default the value is set to the max number of zones } else { $shipping = -1; $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone); $zones_table = preg_split("/[:,]/" , $zones_cost); $size = sizeof($zones_table); $free_shipping_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_FREESHIP_" . $dest_zone . "'"); $free_ship = mysql_fetch_assoc($free_shipping_query); $shipping_price = $free_ship['configuration_value']; if((tep_db_num_rows($free_shipping_query) != 0 ) && ($shipping_price <= $order->info['total']) && !empty($free_ship['configuration_value'])) { $shipping_method = MODULE_SHIPPING_ZONES_FREESHIP_TEXT_WAY . ' ' . $order->delivery['country']['title'] . ': '; if ($shipping_num_boxes > 1) { $shipping_method .= $shipping_num_boxes . 'x '; } $shipping_price = 0; $shipping_method .= $shipping_price . ' ' . MODULE_SHIPPING_ZONES_FREESHIP_TEXT_UNITS; $shipping_cost = 0; } else { for ($i=0; $i<$size; $i+=2) { if ($shipping_weight <= $zones_table[$i]) { $shipping = $zones_table[$i+1]; $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $order->delivery['country']['title'] . ': '; if ($shipping_num_boxes > 1) { $shipping_method .= $shipping_num_boxes . 'x '; } $shipping_method .= $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS; break; } } Quote
greasemonkey Posted August 20, 2017 Posted August 20, 2017 There are built in functions for all mysqli calls... Without looking for more than a second from my phone you could try changing to from myslq_fetch_assoc to tep_fetch_array Quote
ghprosvs Posted August 23, 2017 Author Posted August 23, 2017 Dear greasemonkey, thank you for your reply, it changed it as per your reply, but than I see the below error: Fatal error: Call to undefined function tep_fetch_array() in C:\xampp\htdocs\UsedGear\catalog\includes\modules\shipping\zones.php on line 185 Any help would be greatly appreciated Kind regards Gerry Quote
greasemonkey Posted August 23, 2017 Posted August 23, 2017 1 hour ago, ghprosvs said: Dear greasemonkey, thank you for your reply, it changed it as per your reply, but than I see the below error: Fatal error: Call to undefined function tep_fetch_array() in C:\xampp\htdocs\UsedGear\catalog\includes\modules\shipping\zones.php on line 185 Any help would be greatly appreciated Kind regards Gerry Sorry yes that was a typo from my phone... try tep_db_fetch_array ghprosvs 1 Quote
ghprosvs Posted August 24, 2017 Author Posted August 24, 2017 20 hours ago, greasemonkey said: Sorry yes that was a typo from my phone... try tep_db_fetch_array Yes that did the trick! thank you so much! :) Quote
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.
Note: Your post will require moderator approval before it will be visible.