0
I have this appointment 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 label of State is as type='text'
, but wanted him to show the query data as type='radio'
, where I have two states (Present and Absent), I want you to learn both and select what was recorded in the table and I want to be able to edit that field (state) and that of Observing. It is possible?
Bruno you motre only 1 state or all? wouldn’t it be better in a buy select?
– Julio Henrique
I only have two states, the present and absent, I want to show both and that appears selected what is recorded in the table, and I want to give the possibility to edit this field (state) and the observation, is possible?
– user87525