I have this query and show it in a table:
<form method="POST" action="">
<fieldset>
<table cellspacing="10">
<tr>
<td>
<strong>Insira data de inicio:</strong> <input type="Date" name="inicio" placeholder="PESQUISAR">
</td>
</tr>
</table>
</fieldset>
<fieldset>
<table cellspacing="10">
<tr>
<td>
<strong>Insira data de fim:</strong> <input type="Date" name="fim" placeholder="PESQUISAR">
</td>
</tr>
</table>
</fieldset>
<input type="submit" name="pesquisa" value="ENVIAR">
</form>
<?php
$servername = "xxx.xxx.x.xx";
$username = "xxxxx";
$password = "xxxxxxxx";
$dbname = "xxxxxxx";
$conn = new mysqli($servername, $username, $password, $dbname);
$conn->set_charset('utf8');
if(isset($_POST['inicio']) && isset($_POST['fim']))
{
$inicio = $_POST['inicio'];
$fim = $_POST['fim'];
$result_cursos = "SELECT DataRegisto,
Dia,
TipoRefeicao,
Refeicao,
Hora,
Motivo,
Sugestao,
Colaborador
FROM centrodb.RegistoDiario
WHERE DataRegisto >= '$inicio' AND DataRegisto <= '$fim'";
$resultado_cursos = mysqli_query($conn, $result_cursos);
$tabela1 .= '<div style="float: center" table align="center">';
$tabela1 .= '<table border="5">';
$tabela1 .= '<tr>';
$tabela1 .='<thead>';
$tabela1 .= '<tr>';
$tabela1 .= '<th>Data</th>';
$tabela1 .= '<th>Dia</th>';
$tabela1 .= '<th>Tipo de Refeição</th>';
$tabela1 .= '<th>Refeicao</th>';
$tabela1 .= '<th>Hora da Refeição</th>';
$tabela1 .= '<th>Motivo do incumprimento</th>';
$tabela1 .= '<th>Sugestões/Observações</th>';
$tabela1 .= '<th>Colaborador</th>';
$tabela1 .= '</tr>';
$tabela1 .='</thead>';
$tabela1 .='<tbody>';
while($rows_cursos = mysqli_fetch_array($resultado_cursos)) {
$tabela1 .= '<tr>';
$tabela1 .= '<td>'.$rows_cursos['DataRegisto'].'</td>';
$tabela1 .= '<td>'.$rows_cursos['Dia'].'</td>';
$tabela1 .= '<td>'.$rows_cursos['TipoRefeicao'].'</td>';
$tabela1 .= '<td>'.$rows_cursos['Refeicao'].'</td>';
$tabela1 .= '<td>'.$rows_cursos['Hora'].'</td>';
$tabela1 .= '<td>'.$rows_cursos['Motivo'].'</td>';
$tabela1 .= '<td>'.$rows_cursos['Sugestao'].'</td>';
$tabela1 .= '<td>'.$rows_cursos['Colaborador'].'</td>';
$tabela1 .= '</tr>';
}}
$tabela1 .= '</tr>';
$tabela1 .='</tbody>';
$tabela1 .= '</table>';
$tabela1 .= '</div>';
echo $tabela1;
?>
I want to add a column to this table to register in the database as a view.
As the example I put this image, have a column to mark as view: