include_once ("baglanti.php");
$degerler = $_POST['keyword'];
$degerler = array_map("strtolower",$degerler);
$data = "";
$name = "";
$name_image = "";
$parcala = array();
for($i = 0; $i < count($degerler); $i++){
if($kmt = mysqli_query($baglan,"select * from isimler where isimler ='$degerler[$i]'")){
$name = $degerler[$i];
for($b = 0; $b < strlen($name); $b++){
$parcala[$b] = substr($name,$b,1);
$name_query = mysqli_query($baglan,"select images.image_url,keyword.keyword from images inner join keyword on keyword.id = images.id where keyword = '$parcala[$b]'");
$name_row = mysqli_fetch_row($name_query);
$name_image .= ""." ";
}
}
else{
$sql = "select images.image_url,keyword.keyword from images inner join keyword on keyword.id = images.id where keyword = '$degerler[$i]'";
$sorgu = mysqli_query($baglan,$sql);
$row = mysqli_fetch_row($sorgu);
$data .= ""." ";
}
}
echo $data.$name_image;
?>
Kodlarım bunlar