Image

Imagelorderunion wrote in Imagephp

problem with adodb

Hi. I'm not really completely sure as to why this is happening. Here's my error message:

Fatal error: Call to a member function Execute() on a non-object in /opt/lampp/htdocs/medievalbattles/current/v8/httpdocs/include/functions.php on line 16

Here's the functions.php line (the whole function, really). Line 16 is $result = $__db->Execute($sql);
----------
// Does this email exist already?
function checkemail($email)
{
    global $dbname;
    $sql = "SELECT * FROM $dbname.accounts WHERE email = '$email'";
    $result = $__db->Execute($sql);
    if ($result->RecordCount >= 1)
    {
        $uid = $result->fields["id"];
        return $uid;
    }
    else
        return false;
}
----------

At the top of functions.php, I am including my config file (include("config.php");)

The contents of config.php are as follows:
----------
#####################
## Database variables
#####################
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$dbname = "mb_game";

/*
* ADOdb Lite v1.30
* http://adodblite.sourceforge.net/index.php
*/
require_once("/opt/lampp/htdocs/medievalbattles/current/v8/httpdocs/adodb/adodb.inc.php");

$__db = ADONewConnection($dbtype);
$__db->debug = false;
$__db->Connect($dbhost, $dbuser, $dbpass);
----------

Any idea as to why I'm getting this error?

(PHP v5.1.4 - MySQL v5.0.21)