0
<?php
echo '
<table border=1>
<tr>
<th>ID Pergunta</th>
<th>Pergunta</th>
<th>Responder</th>
</tr>
'
;
include ("ligabd.php");//CONECTAR A BD
$sql="SELECT * from pedido WHERE ID_pr=".$_SESSION['ID'];
$sql1="SELECT * from resposta";
$resultado = mysql_query($sql);
while ($sql = mysql_fetch_array($resultado)) {
echo '
<tr>
<td><form method="post" action="resposta.php" class="login">
<input type="text" name="pergunta_id" id="pergunta_id" value= ' ;?> <?php echo $sql['ID']; ?> <?php echo ' > </td>
<td>'.$sql['pergunta'].'</td>
<td> ';
if (!isset($sql1['resposta'])!=""){
echo '<button type="submit" class="login-button">Responder</button>
</td>
</tr>';
}
else echo 'Pergunta Respondida';
}
echo '</table>';
?>
Good morning, I have a doubt in this code, I want the if show me a button if the record of the answer is clean.
For example, I have a question like in the following image:
if already answered appeared "Question Answered", and if not answered appeared the button