Exemplo n.º 1
0
$db->where("id", 2);
$db->orWhere("customerId", 11);
$r = $db->get("users");
if ($db->count != 2) {
    echo "Invalid users count on orWhere()";
    exit;
}
///
$db->where("lastName", NULL, '<=>');
$r = $db->get("users");
if ($db->count != 1) {
    echo "Invalid users count on null where()";
    exit;
}
///
$db->join("users u", "p.userId=u.id", "LEFT");
$db->where("u.login", 'user2');
$db->orderBy("CONCAT(u.login, u.firstName)");
$products = $db->get("products p", null, "u.login, p.productName");
if ($db->count != 2) {
    echo "Invalid products count on join ()";
    exit;
}
///
$db->where("id = ? or id = ?", array(1, 2));
$res = $db->get("users");
if ($db->count != 2) {
    echo "Invalid users count on select with multiple params";
    exit;
}
///