I have the php code from my table below:
<?php
$db_host = 'localhost';
$db_user = 'west_cad';
$db_pwd = '******';
$database = 'west_cadastro';
$table = 'clientes';
if (!mysql_connect($db_host, $db_user, $db_pwd))
die("Can't connect to database");
if (!mysql_select_db($database))
die("Can't select database");
// sending query
$result = mysql_query("SELECT * FROM {$table}");
if (!$result) {
die("Query to show fields from table failed");
}
$fields_num = mysql_num_fields($result);
echo "<h3>Tabela (Tempo Real) de Pedidos de Internet / viabilidades - site West -</h3>";
echo "<table border='1'><tr>";
// printing table headers
for($i=0; $i<$fields_num; $i++)
{
$field = mysql_fetch_field($result);
echo "<td>{$field->name}</td>";
}
echo "</tr>\n";
// printing table rows
while($row = mysql_fetch_row($result))
{
echo "<tr>";
// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
foreach($row as $cell)
echo "<td>$cell</td>";
echo "</tr>\n";
}
mysql_free_result($result);
?>
Then it returns me the following result:
<html><head><title>Cadastros West</title></head><body>
<h3>Tabela (Tempo Real) de Pedidos de Internet / viabilidades - site West -</h3><table border="1"><tbody><tr><td>nome</td><td>email</td><td>telefone</td><td>endereco</td><td>num</td><td>complemento</td><td>cidadeselecionada</td><td>bairro</td><td>Data / Hora</td><td>id</td></tr>
<tr><td>jose junior</td><td>[email protected]</td><td>(22) 9983-</td><td>Rua Inhamuns</td><td></td><td></td><td>Rio de Janeiro</td><td>Vila Valqueire</td><td>0000-00-00 00:00:00</td><td>5</td></tr>
<tr><td>Sergio Ricardo França da Silva</td><td>[email protected]</td><td>(22) 9997-</td><td>Rua Nicola Aslan</td><td>casa 2</td><td>769</td><td>Cabo Frio</td><td>Braga</td><td>2017-05-23 12:00:01</td><td>6</td></tr>
<tr><td>Lucas silva cardoso dos santos</td><td>[email protected]</td><td>(22) 2629-</td><td>Rua da Luz</td><td>23a</td><td>perto da estácio casa</td><td>Cabo Frio</td><td>Braga</td><td>2017-05-23 12:13:00</td><td>7</td></tr>
<tr><td>Frederico José S. R. N.S. de Siqueira</td><td>[email protected]</td><td>(22) 9883-</td><td>Rua Marechal Floriano</td><td>199</td><td>casa</td><td>Cabo Frio</td><td>São Bento</td><td>2017-05-23 12:23:01</td><td>8</td></tr>
<tr><td>cristiano da silva alves pinheiro</td><td>[email protected]</td><td>(22) 9925-51513</td><td>rua nilo peçanha </td><td>46</td><td>em frente condominio mor</td><td>Arraial do Cabo</td><td>praia dos anjos</td><td>2017-05-25 08:35:48</td><td>23</td></tr>
<tr><td>Angelo Miranda Jaggi</td><td>[email protected]</td><td>(21) 9688-88445</td><td>Rua Maestro Clodomiro Guimaraes Oliveira</td><td>38</td><td>ap 502</td><td>Cabo Frio</td><td>Passagem</td><td>2017-05-23 15:21:48</td><td>15</td></tr>
<tr><td>Nathan Caluete</td><td>[email protected]</td><td>(21) 9823-46426</td><td>Rua Pitanga</td><td>32</td><td>cass 2</td><td>Cabo Frio</td><td>Portinho</td><td>2017-05-23 11:23:18</td><td>16</td></tr>
<tr><td>julio caruso</td><td>[email protected]</td><td>(21) 9801-85859</td><td>Rua Siqueira Campos</td><td>253</td><td>1004</td><td>Rio de Janeiro</td><td>Copacabana</td><td>2017-05-24 14:23:18</td><td>17</td></tr>
<tr><td>AdÃlson Freitas bezerra</td><td>[email protected]</td><td>(21) 9759-61653</td><td>Rua Maraca</td><td>49</td><td>Fundos</td><td>Rio de Janeiro</td><td>Tomás Coelho</td><td>2017-05-24 17:13:18</td><td>18</td></tr>
<tr><td>VANESSA SILVA</td><td>[email protected]</td><td>(21) 3331-1515</td><td>Rua Francisco Real</td><td>1896</td><td>sala 202</td><td>Rio de Janeiro</td><td>Bangu</td><td>2017-05-24 18:23:48</td><td>19</td></tr>
<tr><td>Loecy moreno Ferreira </td><td>[email protected]</td><td>(21) 9648-01983</td><td>Caminho da Fazenda</td><td>8</td><td>Na rua do morro cavado en</td><td>Rio de Janeiro</td><td>Guaratiba</td><td>2017-05-25 10:10:49</td><td>24</td></tr>
<tr><td>Rodrigo de Siqueira Romaro</td><td>[email protected]</td><td>(21) 3563-2849</td><td>Rua General Goes Monteiro</td><td>8</td><td>Bloco A 1904</td><td>Rio de Janeiro</td><td>Botafogo</td><td>2017-05-25 10:15:21</td><td>25</td></tr>
</tbody></table>
</body></html>
Question !!! How can I make a Date SEARCH FILTER on this table? help me please ! Noobie in php + sql