Hello forum! I was tinkering with a login script and I came accross the following error: Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/content/79/9398479/html/abyss/dio.php on line 60
//Code here:
<?php
$sqlError = 'We are experiencing very temporary downtime, please refresh or try again in 10 minutes.';
$sqlCon = mysql_connect('database', 'username', 'password');
if (!$sqlCon) {
die($sqlError);
}
function cleanup($data) {
return mysql_real_escape_string($data);
}
mysql_select_db('dbName', $sqlCon) or die($sqlError);
function userActive($username) {
$username = cleanup($username);
$query = mysql_query("SELECT COUNT(`ID`) FROM `users` WHERE `username` = '$username' AND `active` == 1"); // <-line 60
return (mysql_result($query, 0) == 1) ? true : false;
}
Any help with this code would be appreciated, as I am truly stumped and cannot figure out what is wrong :/