I am trying to loop through my database and then shown all user names. Unfortunately I have tried many different ways but can not get it to work. I am currently trying this
<?php
$result= mysqli_query("SELECT * FROM users");
while($userRow = mysqli_fetch_array($result)){
echo $userRow['user_name'];
}
?>
The issue is that I am getting this error and can not work out how to get this working. Warning: mysqli_query() expects at least 2 parameters, 1 given
I am able to show a single row using
<?php print($userRow['user_name']); ?>
But I can not work out how to loop through every user in my 'user' table