[ticket/9992] Use sql_fetchfield for single row and single column result

PHPBB3-9992
This commit is contained in:
Nils Adermann 2011-06-10 18:37:29 +02:00
parent 2dee57fd43
commit c8828473a8

View file

@ -85,9 +85,8 @@ function login_db($username, $password, $ip = '', $browser = '', $forwarded_for
} }
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$attempts_row = $db->sql_fetchrow($result); $attempts = (int) $db->sql_fetchfield('count');
$db->sql_freeresult($result); $db->sql_freeresult($result);
$attempts = $attempts_row['count'];
$attempt_data = array( $attempt_data = array(
'attempt_ip' => $ip, 'attempt_ip' => $ip,