Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help Please - mysql_fetch_array() expects parameter 1 to be resource, object given in


Guest

Recommended Posts

Posted

Hi All

 

Don't quite know what has happened but it looks like my host has upgraded server or software on the server and now I get a few errors:

 

error 1:

 

Warning: mysql_fetch_array() expects parameter 1 to be resource, object given in /home/*****/public_html/includes/modules/boxes/bm_whats_new.php on line 57

 

bm_whats_new.php

 

56 $description_query = tep_db_query($sql);

57 $description = mysql_fetch_array($description_query, MYSQL_ASSOC);

58 $description['products_description'] = substr($description['products_description'], 0, 90);

 

 

error 2

 

Warning: mysql_fetch_array() expects parameter 1 to be resource, object given in /home/******/public_html/includes/modules/new_products.php on line 36

 

new_products.php

 

35 $description_query = tep_db_query($sql);

36 $description = mysql_fetch_array($description_query, MYSQL_ASSOC);

37 $description['products_description'] = substr($description['products_description'], 0, 65);

 

 

error 3

 

Warning: mysql_fetch_array() expects parameter 1 to be resource, object given in /home/*****/public_html/includes/modules/product_listing.php on line 179

 

product_listing.php

 

178 $description_query = tep_db_query($sql);

179 $description = mysql_fetch_array($description_query, MYSQL_ASSOC);

180 $description['products_description'] = substr($description['products_description'], 0, 50);

 

 

if any one with more brains than me can assist would be most apprecaitive..

 

Regards

 

Liam

Posted

That looks like you have some poorly-coded modifications to your osCommerce code. Try changing mysql_fetch_array to tep_db_fetch_array in all three locations. You'll also need to remove the , MYSQL_ASSOC from all three. Don't forget to remove the comma.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Posted

Hi Jim

 

Thanks for that worked a treat... the coding is from oscommerce 2.3.3. from a template from mindsparxs so that might have something to do with it but was working OK since last night but I think the website has been moved to another server my ftp still works but the file edits that you mentioned would not work after upload and had to do the edits in cpanel file manager as they still showed the old code...

 

Anyway many thanks

 

Liam

Posted

The usual cause is an update to your version of PHP. Ask your hosting service if they have done this. If so, you may have other problems that will need to be addressed.

 

Regards

Ji

See my profile for a list of my addons and ways to get support.

Posted

Hi

 

Yes they did update to PHP Version 5.4.24 I have been through every function of the website and is satisfied that no other problem have arrison..

 

Regards

 

Liam

Archived

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

×
×
  • Create New...