Call to undefined method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vegascoop
    New Member
    • Dec 2007
    • 1

    #1

    Call to undefined method

    I'm moving a script from PHP4 to PHP5. Everything works under PHP4.

    When I run the script under PHP5, I get the following error message:

    Call to undefined method Database::doQue ry()

    Here is the offending code:
    [code=php]
    function getBaseURL( )
    {
    $this->db->doQuery( "SELECT value FROM base_Config WHERE config='".CFG_F IELD_BASE_URL." ' LIMIT 1" );
    $row = $this->db->nextAssoc( );
    return $row['value'];
    }
    [/code]
    Since the code works under PHP4, I suspect that the issue has to do with changes to OO functions which were acceptable under PHP4, which no longer work under PHP5, however, I am really not sure. Any suggestions to point me in the right direction would be appreciated.
    Last edited by pbmods; Dec 23 '07, 10:17 PM. Reason: Added CODE tags.
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Vegas. Welcome to TSDN!

    You might have a Database class defined elsewhere in your PHP 5 installation (such as in your PEAR directory).

    Try setting your include_path to only include directories in your application.

    Comment

    Working...