Forum Moderators: coopster
$query = "SELECT `no_of_logons` FROM `users` WHERE `userid` = '".$userid."' AND `password` = '".$password."'";
$result = mysqli_query($db,$query);
if ($result){
while($item = $result->fetch_object($result)){
echo "<pre>";
print_r($item -> no_of_logons);
echo "</pre>";
}
else{
echo "Query Unsuccessful";
exit;
}
...is better to concentrate on learning the object oriented approach or the procedural style
Do not pass $result to the fetch_object() method, unless using the mysqli_fetch_object() procedural style call