I must be missing something very obvious here, but I don't understand what I am doing wrong here. For some reason, $row is coming out empty, which should not happen. I am getting no error though.
$uname=mysqli_real_escape_string($conn,$_SESSION["username"]);
$query1="SELECT user_id FROM users WHERE username='$uname'";
$results=$conn->query($query1);
if($results->num_rows>0){
while($row=$results->fetch_assoc()){
$uid=mysqli_real_escape_string($row["user_id"]);
}
}
I am sorry if this is a bad question, I will delete it right after, but I would appreciate any help.
$rowcount=mysqli_num_rows($result)