On Tue, Jul 19, 2011 at 04:05, Dr Michael Daly <g...@holisticgp.com.au> 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 ) {

    Change that to:

        if (is_object($db_res)) {

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

    Right.  Before, it was succeeding on `strlen($db_res) > 0`
because - like an array - when called as a string, it was evaluating
to its variable type.  For example:

<?php
    $a = array('soo' => 'per', 'doo' => 'per');
    echo $a; // Prints: Array

    $b = new fakeClass(); // Presuming this class exists
    echo $b; // Used to print: Object id #1
?>

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

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

Reply via email to