Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
<?php header('Content-Type: text/html; charset=iso-8859-1');?>
<?php
$host = "localhost";
$user = "root";
$pass = "";
$banco = "slp";
$conexao = mysqli_connect($host, $user, $pass) or die(mysqli_error());
mysqli_select_db($conexao, $banco) or die(mysqli_error($conexao));
$palavra = $_POST['palavra'];
$sql = mysqli_query($conexao,"SELECT * from cadastros WHERE nomeProfEfetivo LIKE '%".$palavra."%' OR matricula LIKE '%".$palavra."%'");
$row = mysqli_num_rows($sql);
?>
<section class="panel col-lg-9">
<header class="panel-heading">
<br/><br/>
</header>
<?php
if($row>0){
?>
<table class="table table-striped table-advance table-hover">
<tbody>
<tr>
<th><i class="icon_profile"></i> Professor</th>
<th width="15"><i class="icon_profile"></i> Matricula</th>
<th><i class="icon_mail_alt"></i> Unidade</th>
<th width="5"><i class="icon_profile"></i> Modalidade</th>
<th width="5"><i class="icon_mail_alt"></i> Ano</th>
<th width="10"><i class="icon_profile"></i> Turma</th>
<th width="10"><i class="icon_mail_alt"></i> Turno</th>
<th width="" ><i class="icon_mail_alt"></i> Tipo do Prof.</th>
</tr>
<?php
while($linha = mysqli_fetch_assoc($sql)){
?>
<tr>
<td width="15"><?=$linha['nomeProfEfetivo'];?></td>
<td width="15"><?=$linha['matricula'];?></td>
<td width="15"><?=$linha['unidade'];?></td>
<td width="15" ><?=$linha['modalidade'];?></td>
<td style="text-align:center" ><?=$linha['ano'];?></td>
<td style="text-align:center"><?=$linha['turma'];?></td>
<td><?=$linha['turno'];?></td>
<td style="text-align:center"><?=$linha['tipo'];?></td>
</tr>
<?php }?>
</tbody>
</table>
<?php
}else{?>
<h4>Nao foram encontrados registros com esta palavra.</h4>
<?php }?>
</section>
**TERIA COMO FAZER O <td><?=linha[] , ACEITA MAS DE UMA VARIÁVEL DO BANCO DEPENDO DO QUE FOI DIGITADO NA BUSCA. **
**EX.. FOI DE DIGITADO O NOME DO PROFESSOR QUE ENTRA NA PRIMEIRA COLUNA DA TABELA "<td><?=$linha['nomeProfEfetivo'];?></td>" NA BUSCA MAS O TIPO DELE VARIA DEPENDO DA SUA FUNÇÃO AI OS TIPOS ENTRARIAM NA ULTIMA COLUNA QUE E TIPO. **Carregando comentários...