schwarzes Posted August 17, 2010 Posted August 17, 2010 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.
Guest Posted August 18, 2010 Posted August 18, 2010 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
schwarzes Posted August 19, 2010 Author Posted August 19, 2010 I changed the database to 4.1 but it did not help.
FIMBLE Posted August 19, 2010 Posted August 19, 2010 This topic might help you find your way http://www.oscommerce.com/forums/topic/218963-warning-mysql-num-rows-supplied-argument-is-not-a-valid-mysql-result-resource-in-databasephp/ Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
FIMBLE Posted August 19, 2010 Posted August 19, 2010 I just had a look at your site and do not see any errors on your product_info.php page Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
schwarzes Posted August 19, 2010 Author Posted August 19, 2010 Which one did you see. Old server or the new server. This is the new server. http://alconlighting.co/product_info.php?products_id=1161
FIMBLE Posted August 19, 2010 Posted August 19, 2010 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
schwarzes Posted August 19, 2010 Author Posted August 19, 2010 Yes I have done that as well. I have seen this error in other websites as well.
FIMBLE Posted August 19, 2010 Posted August 19, 2010 post your product_info.php so we can take a look nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
schwarzes Posted August 19, 2010 Author Posted August 19, 2010 <?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'); ?>
multimixer Posted August 19, 2010 Posted August 19, 2010 Just went to see and both sites, old and new, look ok My community profile | Template system for osCommerce - New: Responsive | Feedback channel
FIMBLE Posted August 19, 2010 Posted August 19, 2010 looks like you are using BTS or something there? you might have more luck finding a solution on the bts forum if there is one. nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
FIMBLE Posted August 19, 2010 Posted August 19, 2010 its the wrong link provided George Nic Sometimes you're the dog and sometimes the lamp post [/url] My Contributions
schwarzes Posted August 19, 2010 Author Posted August 19, 2010 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.