I have this query and I show it this way:
<?php
if(isset($_POST['data']))
{
$servername = "xxx.xxx.x.xx";
$username = "xxxxx";
$password = "xxxxxxxx";
$dbname = "xxxxxxx";
$conn = new mysqli($servername, $username, $password, $dbname);
$conn->set_charset('utf8');
$inicio = mysqli_real_escape_string($conn, $_POST['data']);
$sql = "SELECT 'regOratorio'.'DataEntrada',
'regOratorio'.'Utente',
'regOratorio'.'Estado',
'regOratorio'.'Observacao',
'regOratorio'.'Colaborador'
FROM 'centrodb'.'regOratorio' WHERE DataEntrada = '$inicio'";
$result=mysqli_query($conn, $sql);
if (!$result) {
echo 'There are no results for your search';
} else {
echo '<form name="customer_details" action="" method="POST" onsubmit="return alguma_funcao()">';
}
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
{
echo "<fieldset>";
echo "<table cellspacing='10'>";
echo "<tr>";
echo "<td>";
echo "<label>Utente</label>";
echo "<input id='' type='text' value='".$row['Utente']."'";
echo "<label>Estado</label>";
echo "<input id='' type='text' value='".$row['Estado']."'";
echo "<label>Observacao</label>";
echo "<input type='text' value='".$row['Observacao']."'";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</fieldset>";
echo "<fieldset>";
echo "<table cellspacing='10'>";
echo "<tr>";
echo "<td>";
echo "<input type='text' value='".$row['Colaborador']."'";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</fieldset>";
}
echo "</form>";
mysqli_close($conn);
}
else
{
?>
<form action="" method="post">
<label>Enter Student Number:</label>
<input name="data" type="date" placeholder="Type Here">
<br>
<br>
<input type="submit" value="Enter">
</form>
<?php
}
?>
The State label is as type='text'
, but I wanted it to show query data as type='radio'
, where I have two states ( Present and > Absent ), I want you to select both and select what has been registered in the table and I want to be able to edit this field ( state ) and strong>. It's possible?