I decided to start switching from mysql to mysqli in an already existing website of mine. So for the next couple days I will be sorting through a lot of code.
My first attempt is this snippet. I already have the connection in an included file, so please keep that in mind.
This code is showing no results at all.
<?php
if($emQuery = mysqli_query($con, "SELECT * FROM employees ORDER BY 'fullname' DESC LIMIT 50")){
$emNum = mysqli_num_rows($emQuery);
if($emNum > 0){
while($emArray = mysqli_fetch_array($emQuery)){
echo($emArray['fullname'].'<br />');
}
}else{
echo('There are no employees to list. Start by adding a new employee.');
}
}
?>
Aucun commentaire:
Enregistrer un commentaire