<?php
if ($_POST){
    $ara=$_POST["ara"];
	$parcala=explode(" ",$ara);
	$sor="select * from ogrenci where ad like ";
	for ($i=0;$i<count($parcala)-1;$i++){
		$sor.="%$parcala[$i]%' or ad LIKE";
	}
	$sor.="'%$parcala[$i]%'";
	$sorgu=mysqli_query($mysqli,$sor);
	if (empty($ara)){
		echo 'Arama alanını boş bıraktın.';
	}else{
		if (mysqli_num_rows($sorgu)>0){
			while($kayit=mysqli_fetch_array($sorgu)){
				echo $kayit["ad"].' '.$kayit["soyad"].' '.$kayit["no"];
				echo '<br/>';
			}
		}else{
			echo 'Eslesen Kayit Yok.';
		}
	}
}else{
?>
<form name="form1" action="index.php?sayfa=arama" method="post">
Aranacak Ad icin Kelime:<input type="text" name="ara"/>
<input type="submit" name="gonder" value="Ara"/>
</form>
<?php
}
?>