I run this simple script to get results posted back to a android app, but when i use some keywords it will refuse to post back any results, however there is data in the database with matching keywords
script
<?php
error_reporting(E_ALL);
echo '{"results":';
if(!empty($_GET["name"]))
{
$link = mysqli_connect("xxxxxxxxxxx", "xxxxxxxxxxx", "xxxxxxxxxxx", "xxxxxxxxxxx");
if (!$link)
{
echo "Error: Unable to connect to MySQL." . PHP_EOL;
echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
exit;
}
$query = "SELECT * FROM allart WHERE COMSCHRIJVING1 LIKE '%" . $_GET["name"] . "%' LIMIT 50";
$result = mysqli_query($link, $query);
if(!empty($result))
{
$i = 1;
$data = array();
while($row = mysqli_fetch_array($result))
{
$data[] = array(
"id" => $i,
"name" => strtolower(ucfirst($row['COMSCHRIJVING1'])),
"article" => $row['CARTIKEL'],
"groep" => strtolower(ucfirst($row['CARTIKELGROEP'])),
"eenheid" => strtoupper($row['CEENHEIDVOORRAAD']),
);
$i++;
}
echo json_encode($data);
}
mysqli_close($link);
}
echo "}";
die();
?>
Script is called like: http://blablabla.com/index.php?name=xxxxxx
Keywords like: "iso" are not posting any results
However when i run it in my sql
SELECT * FROM `allart` WHERE `COMSCHRIJVING1` LIKE '%iso%'
Showing rows 0 - 24 (662 total, Query took 0.0028 seconds.)
All other keywords i try is posting results, but the one i really need is not working..
Why is this not working?
Thx in advance