1
I need to check if my 'Select', is returning records to then load the data on the screen. Below follows the code I am using:
$sql = mysqli_query($conn,"SELECT * FROM USUARIOS;");
$linhas=mysqli_num_rows($sql);
//eu preciso verificar aqui!!!!!
while ($linhas = mysqli_fetch_array($sql, MYSQLI_ASSOC)) {
echo "<td hidden='true'>". $linhas['id'] ."</td>";
echo "<td>". $linhas['nome'] ."</td>";
}
Based on the above code how should I check if the query returned records?
Because if you have not returned, I will display a message on the screen, "There is no registered record yet".
The goal is: When you have no records, no error returns.
Obs.: when you have registered data wheel perfectly
Thank you very much friend!!!! It worked out right.!!
– PauloGalego
@Paulogalego mark the answer as useful please since it solved your problem !
– denis