Redeem BD Data Only Preceded

0

I have a problem when I have to show the data in the Database and they are empty because the name appears and the space is blank.

Nome: Pedro
Nome: Ricardo
Nome:
Nome:
Nome:

and wanted to know if it was possible to change this to just show the Filled data

   <p><b>Nome :</b> '.$exibe["Nome1"].' &nbsp;  &nbsp;  &nbsp; <b> Função :   </b>'.$exibe["Funcao1"].'</p>

        <p><b>Nome :</b> '.$exibe["Nome2"].' &nbsp;  &nbsp;  &nbsp; <b> Função : </b> '.$exibe["Funcao2"].'</p>

        <p><b>Nome :</b> '.$exibe["Nome3"].' &nbsp;  &nbsp;  &nbsp; <b> Função : </b> '.$exibe["Funcao3"].'</p>

        <p><b>Nome :</b> '.$exibe["Nome4"].' &nbsp;  &nbsp;  &nbsp; <b> Função : </b> '.$exibe["Funcao4"].'</p>

        <p><b>Nome :</b> '.$exibe["Nome5"].' &nbsp;  &nbsp;  &nbsp; <b> Função : </b> '.$exibe["Funcao5"].'</p>

        <p><b>Nome :</b> '.$exibe["Nome6"].' &nbsp;  &nbsp;  &nbsp; <b> Função : </b> '.$exibe["Funcao6"].'</p>

        <p><b>Nome :</b> '.$exibe["Nome7"].' &nbsp;  &nbsp;  &nbsp; <b> Função : </b> '.$exibe["Funcao7"].'</p>

        <p><b>Nome :</b> '.$exibe["Nome8"].' &nbsp;  &nbsp;  &nbsp; <b> Função : </b> '.$exibe["Funcao8"].'</p>
    
asked by anonymous 05.06.2014 / 15:45

2 answers

2

Does not this work?

while($exibe = mysql_fetch_array($resultadoQuery) {
     if($exibe[nome] != NULL) {
          echo "<p><b>Nome: </b>$mostrar[nome] -- $mostrar[funcao]</p>
     }

EDIT:

You can not do this (just as you posted in the comment):

<p>
      <?php if($exibe['nome6'] != NULL) {
            echo '<p><b>Nome: </b>'.$exibe['nome6'].'&nbsp;&nbsp; <b>Função: </b>'.$exibe['funcao6'];
           }
      ?>
</p>

    
05.06.2014 / 19:17
0

You can modify the query to

    SELECT * FROM tabela WHERE 'nome' != NULL
    
05.06.2014 / 15:54