Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP 5.2 issue?


po10cySA

Recommended Posts

Posted

Hi guys, my online store receives the following error when accessing a custom php file I created:

 

PHP Fatal error: Call to a member function Execute() on a non-object

 

The server uses PHP5.2, my custom file is used to retrieve db info and send it to an affiliate to display our products on their site.

 

Line 99 which the error appears at reads as:

 

$check_query = $db->Execute("SELECT categories_id, categories_name FROM ".TABLE_CATEGORIES_DESCRIPTION." where language_id=1");

 

any help? zencart users have the same issue and it appears a compatability issue with PHP 5.2.. However their workaround of editing sessions.php as follows does not work as I get a error stating function queryFactory() not found:

 

Change:

 

function _sess_write($key, $val) {

global $db;

global $SESS_LIFE;

 

To:

 

function _sess_write($key, $val) {

// The following is only to work around a PHP 5.2.0 bug:

global $db;

if (!is_object($db)) {

//PHP 5.2.0 bug workaround ...

$db = new queryFactory();

$db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false);

}

 

global $SESS_LIFE;

 

 

Is there a similar workaround anyone has found for OSC?? Please help.

 

Thanks in advance

Posted

Your Line 99 is not an osCommerce database query. It appears to be designed for Zen Cart. The equivalent in osCommerce would be:

 

$check_query = tep_db_query("SELECT categories_id, categories_name FROM ".TABLE_CATEGORIES_DESCRIPTION." where language_id=1");

Regards

Jim

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

Archived

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

×
×
  • Create New...