开发者

ezSQL check affected rows

With adodb i checked affected rows like this:

$user_data = get_login_name($user_name, $password);
//0 = id
//1 = username
//2 = password

if (!$开发者_运维问答myDB->Affected_Rows($user_data[1], $user_data[2])) {
    echo "everything good";
    } else {
        echo "bad";
    }

How to check it with ezSQL ?


Old question but I ended up here wanting the answer and I've just found it. This works in ezSQL.

$db->rows_affected;


Ech, kind sorted it my self:

    $user_data = get_login_name($user_name, $password);
        //$user_data[0]->id = id
        //$user_data[0]->username = username
        //$user_data[0]->password = password
}
if ($user_data[0]->username == null and $user_data[0]->password == null) {
    $error = '1';
    $error_message = 'Incorrect username or password.';
} else {
//do my stuff
}

If somebody know better solution, please post it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜