0

i am very new in php, iam trying to figure it out why iam getting this error Notice: Undefined variable: rowcount in C:\laragon\www\project1\index.php on line 19

The database connection is successful

the php code is this

<?php 

$sql = "SELECT * FROM users";
$result = mysqli_query($conn, $sql);
$rowCount = mysqli_num_rows($result);

if ($rowcount > 0){
    while($row = mysqli_fetch_assoc($result)){
        echo $row['username']. "<br>";
    }
} 
else {
    echo "no results found";
}

?>

0 Answers0