Example #1
0
//
$sql = <<<EOD
UPDATE
    {$options['table_prefix']}{$tableName}
    SET
        password = md5(concat(salt, ?))
    WHERE
        username = ?;
EOD;
$db->execute($sql, ['doe', 'doe']);
$db->execute($sql, ['admin', 'admin']);
//
// Check whats in the db
//
$db->select("*")->from($tableName);
$res = $db->executeFetchAll();
echo "<pre>" . print_r($res, 1) . "</pre>";
//
// Check password for each user
//
$db->select("username")->from($tableName)->where("username = ?")->andWhere("password = md5(concat(salt, ?))");
$res = $db->executeFetchAll(['doe', 'doe']);
echo "<pre>" . print_r($res, 1) . "</pre>";
//
// Check password for each user
//
$db->select("username")->from($tableName)->where("username = ?")->andWhere("password = md5(concat(salt, ?))");
$res = $db->executeFetchAll(['admin', 'admin']);
echo "<pre>" . print_r($res, 1) . "</pre>";
//
// Check (wrong) password for user