10
How can I display the results of a query in a table of an html page?
Below is what I was able to do. However, the code only shows the first record.
include("conectar.php");
$sql = mysql_query("Select * From tb_trabalhador and tb_detalhe_trabalhador");
$exibe = mysql_fetch_assoc($sql);
echo "<table>";
echo "<tr><td>Nome:</td>";
echo "<td>".$exibe["Nome"]."</td></tr>"; e os outros campos
Thank you. Just another question. When I show the data I want it to show me the result if it is filled or show me (N/A). Code: echo "<td>". (!Empty($displays["Address"]) ? $displays["Address"] "(N/A)")." </td></tr>";
– ChrisAdler
Guess an if inside the while,
if($exibir['nome']){
 echo $exibir['nome'];
}else{
 echo 'N/D';
}
– rray
echo "<td>"; if (Trim($displays['Address']) != "") {echo $displays['Address'];} Else {echo "N/D";} echo "</td></tr>"; my data continues to be shown twice S:
– ChrisAdler
Any problem with the answer?
– rray