Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

A problem after site transfer


schwarzes

Recommended Posts

Hello,

 

I have just transferred an oscommerce website from one domain to another. One had Plesk while this new one is in GoDaddy.

 

In the product info page, I am getting the following error in the godaddy installation.

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\Hosting\6419513\html\alconlighting.co\includes\functions\database.php on line 104

 

here is the old website

 

Old Website

 

here is the godaddy website where the problem is..

 

New Website

 

Here is some bit of code of the database.php file.

 

99  function tep_db_fetch_array($db_query) {
100      return mysql_fetch_array($db_query, MYSQL_ASSOC);
101 }
102
103 function tep_db_num_rows($db_query) {
104      return mysql_num_rows($db_query);
105 }
106
107 function tep_db_data_seek($db_query, $row_number) {
108      return mysql_data_seek($db_query, $row_number);
109 }

 

Can anyone tell me how to solve this issue.

 

Thanks.

Link to comment
Share on other sites

It appears you have changed MYSQL version, probably from 4 to 5. Godaddy offers SQL in 4 and 5. Try loading the database into a MYSQL 4 database. If that does not correct the issue, then you will need to upgrade your website to the latest version. (which might be a better idea anyway)

 

 

Chris

Link to comment
Share on other sites

<?php
/*
 $Id: product_info.php,v 1.1.1.1 2004/03/04 23:38:02 ccwjr Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);

//check if product is really a subproduct
 $product_sub_product_query = tep_db_query("select products_parent_id from " . TABLE_PRODUCTS . " p where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
 while ($product_sub_product = tep_db_fetch_array($product_sub_product_query)){
 $product_sub_check = $product_sub_product['products_parent_id'];
 }

 if ($product_sub_check > 0){
  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_sub_check));
 }
//check to see if products have sub_products
$product_has_sub = '0';
$sub_products_sql1 = tep_db_query("select p.products_id, p.products_price, p.products_image, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_parent_id = " . (int)$HTTP_GET_VARS['products_id'] . " and p.products_quantity > '0' and p.products_id = pd.products_id and pd.language_id = " . (int)$languages_id);
if (tep_db_num_rows($sub_products_sql1) > 0) {
$product_has_sub = '1';
}else{
$product_has_sub = '0';
}

 $content = CONTENT_PRODUCT_INFO;
 $javascript = 'popup_window.js';

 require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...