I created a frame on the intranet through WordPress (php, MySQL) to list the extensions of company employees. Clicking the link of extensions displays a table and the scroll bar for viewing the list. I need to create a search field (field created but with no functionality yet) on this page so that the user has the option of instead of looking for the list whom she wants, she type the name of the person, click search and when doing this the table if you restrict only people with the name or part of the name that matches the person you entered. How to do this? Follow me current code.
<!-- Campo para pesquisa -->
<input type="text" name="texto" placeholder="Digite a pesquisa" />
<button type="submit">Buscar</button></div><br><br>
<?php
$sql = "SELECT ramal, setor , coalesce (funcionario, setor) as funcionario FROM ramais ORDER BY funcionario asc";
$dados = mysql_query($sql);
$linha = mysql_fetch_array($dados);
?>
<table class="lista-ramais">
<?php
$ramal = ($linha['ramal']);
$setor = ($linha['setor']);
$funcionario = ($linha['funcionario']);
$classe = "";
if ( $linha['ramal'] <> " " ) { $classe=" style='background:#E0DEFE'";
echo "</table><br /><table class='lista-ramais'><tr><th " . $classe . ">Usuário</th><th " . $classe . ">Ramal</td> <th " . $classe . ">Setor</th></tr>";
while ( $linha = mysql_fetch_array($dados) ) {
echo "<tr><td align=left>" . ucwords($linha['funcionario']) . "<br /></td><td>" . ucwords($linha['ramal']) . "</td> <td>" . ucwords($linha['setor']) . "</td></tr>";
}
}
?>
</table>