vendredi 23 décembre 2016

How to tell if a query is empty? [duplicate]

This question already has an answer here:

I have this Website where I create groups. I want the html to show a message to inform the user that he as to create a group if the table(that stores the names of the groups) is empty!! I have this code but I think this is not the proper way, can you help me?

if ($row = mysqli_fetch_array($result6)){
            ?>
    <center><th<b> <tr><td><?php echo $row['titulogrupo'];?></td></tr>  <?php } ?> 
<?php
                else if ($row = mysqli_fetch_array($result6) = 0){
            ?>
    <center><th<b> <tr><td>Aceda ás definições para criar um grupo</td></tr>    <?php } ?> 

Aucun commentaire:

Enregistrer un commentaire