Re: ? simple solution for error resulting from upgrade to php5
| From: | Tamara Temple | Date: | Tue, 19 Jul 2011 08:37:40 +0000 |
| Subject: | Re: ? simple solution for error resulting from upgrade to php5 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314114@lists.php.net to get a copy of this message | ||
On Jul 19, 2011, at 3:05 AM, Dr Michael Daly wrote:
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; } }What does short_query_cache[] contain?