Exemplo n.º 1
0
}
// order by field
$db->orderBy("login", "asc", array("user3", "user2", "user1"));
$login = $db->getValue("users", "login");
if ($login != "user3") {
    echo "order by field test failed";
    exit;
}
$db->where("active", true);
$users = $db->get("users");
if ($db->count != 1) {
    echo "Invalid total insert count with boolean";
    exit;
}
$db->where("active", false);
$db->update("users", array("active" => $db->not()));
if ($db->count != 2) {
    echo "Invalid update count with not()";
    exit;
}
$db->where("active", true);
$users = $db->get("users");
if ($db->count != 3) {
    echo "Invalid total insert count with boolean";
    exit;
}
$db->where("active", true);
$users = $db->get("users", 2);
if ($db->count != 2) {
    echo "Invalid total insert count with boolean";
    exit;