Page 1 of 1

Trouble with code

Posted: Sat Jan 22, 2005 12:57 pm
by rs131
I get this error:

Fatal error: Undefined class name 'db' in /home/eatsp1es/public_html/developers/portal/adduser.php on line 18

Line 18: if (DB::isError($name_check)) { Heres the script below:

Code: Select all

if (!get_magic_quotes_gpc()) { 
        $username = addslashes($username); } 
    $name_check = mysql_query("SELECT Username FROM users WHERE Username=$username"); 

    if (DB::isError($name_check)) { 
        return($name_check->getMessage()); 
    } 

    $name_checkk = $name_check->numRows(); 

    if ($name_checkk != 0) { 
        return('Sorry, the username: $username is already taken, please pick another one.'); $errors++;}

help would be appreciated, thanks....

Posted: Sat Jan 22, 2005 3:17 pm
by feyd
you don't have a class named 'db'

Posted: Sat Jan 22, 2005 5:22 pm
by hunterhp
BTW, you also have a spelling error(Don't know if it's intended).

On your third if statement, it says if ($name_checkk... it has 2 k's. Again, don't know if it's intended, but you might wanna fix that if it's not intended.