Fix if statement in db.php