Could someone debug this and tell me why is is not working?
<?php
include("C:\Wamp\www\system\db\connect.php");
$term = mysqli_real_escape_string($con, $_GET['q']);
echo "results for \"".$term."\".<br>";
$sql = "SELECT * FROM `search` WHERE Keywords='%{$term}%' LIMIT 10";
$result = mysqli_query($con, $sql) or die("<p color=\"#f00\">Could not query database.</p>");
while($row = mysqli_fetch_assoc($result) or die("<p color=\"#f00\">Could not fetch assoc array in database.</p>")) {
echo $row['Title'];
}
echo json_encode($row['Title']);
mysqli_close($con);
?>
It stops working at the mysqli_fetch_assoc
function.