문제

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 ?

도움이 되었습니까?

해결책 2

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.

다른 팁

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

$db->rows_affected;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top