? simple solution for error resulting from upgrade to php5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi
is there a simple solution here, other than reverting to php4?
An upgrade from php5 to php5 has resulted in an error msg in this line:

if(  strlen($db_res ) > 0 ) {

I understand this is bec. php5 is object orientated. It says an
Object of class DB_result could not be converted to a string


This is the full function:


function pbcs_db_query( $q , $die_on_error=true, $ext_db_handle="" ) {
	global $db_handle;
	global $db_res;
	global $query_logging,$PHP_SELF;
	global $short_query_cache,$short_query_caching;

	if( $ext_db_handle == "" )
		$query_db_handle = $db_handle;
	else
		$query_db_handle = $ext_db_handle;

	if( $short_query_caching && strlen( $q ) < 80 ) {
		$db_res = $short_query_cache[str_replace(" ","",$q)];
		if(  strlen($db_res ) > 0 ) {
			//do_log("object.log","READ: ".$db_res);
//			$db_res->resetResultSet( 0 );
			mysql_data_seek( $db_res->result , 0 );
			//do_log("query.log",$PHP_SELF." - FROM-CACHE - ".$q);

			return $db_res;
		}
	}



Thanks
Michael

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux