Skip to content

Instantly share code, notes, and snippets.

@kevsersrca
Created December 6, 2015 11:45
Show Gist options
  • Save kevsersrca/f89851064c52176db63e to your computer and use it in GitHub Desktop.
Save kevsersrca/f89851064c52176db63e to your computer and use it in GitHub Desktop.
Search
<meta charset="utf-8">
<?php
include("connect.php");
?>
<form action="" method="post" name="formm">
<table>
<input type="text" name="ara" style="padding:15px;" placeholder="İsme göre arama yapınız" />
<input type="submit" style="padding:15px; background:purple; color:white; font-weight:bold;" value="Ara" />
</table>
</form>
<?php
if(isset($_POST["ara"])){
$gelen=$_POST["ara"];
if(empty($gelen)){
echo "<script> alert(' Lütfen aranacak bir karakter giriniz. ') </script>";
}
else{
$ara=$db->prepare(' SELECT * FROM kullanici_bilgileri WHERE ad LIKE :keywords ' );
$ara->bindValue(':keywords', '%'.$gelen.'%');
$ara->execute();
$liste =$ara->fetchAll(PDO::FETCH_ASSOC);
?>
<table>
<?php
foreach($liste as $row ){
?>
<tr>
<td>AD :<?php echo $row["ad"]; ?> </td>
</tr>
<tr>
<td>SOYAD: <?php echo $row["soyad"]; ?> </td>
</tr>
<tr>
<td>TEL: <?php echo $row["tel"]; ?> </td>
</tr>
<tr>
<td>EMAİL: <?php echo $row["email"]; ?> </td>
</tr>
<tr>
<td>NOT: <?php echo $row["notlar"]; ?> </td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<?php
}
?>
</table>
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment