$sql = $conn->prepare('SELECT * FROM users WHERE user_id != null');
if($sql->rowCount() > 0){
}
else{
echo "there are no users"
}
I want to select all data from a table however the code above does not work. It echoes/prints out "there are no users." No errors are shown too.
Best Answer
always fails. Instead, say
And you need to
->execute
it.