Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

A problem after site transfer


schwarzes

Recommended Posts

Posted

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.

Posted

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

Posted

Looks like its the add to cart button that is causing your problems, have you tried to re upload the database.php and the product_info.php again?

 

Nic

Sometimes you're the dog and sometimes the lamp post

[/url]

My Contributions

Posted
<?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');
?>

Posted

Thanks for the replies.

 

But I wonder if there is something wrong in the code of the template, then how come there is no error at all in the old website.

 

Thanks.

Archived

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

×
×
  • Create New...