I'm creating a search system for users on my site. However I am facing the following error:
ThisisthecodeI'musing:
<body>
<h2>Resultados da tua pesquisa</h2><br />
<?php
$query = $_GET['query'];
$min_length = 3;
if (strlen($query) >= $min_length) {
$query = htmlspecialchars($query);
$query = mysql_real_escape_string($query);
$raw_results = mysql_query("SELECT * FROM usuario WHERE ('nome' LIKE '%".$query."%')") or die(mysql_error());
if (mysql_num_rows($raw_results) > 0) {
echo "<br /><br />";
while ($results = mysql_fetch_array($raw_results)) {
echo '<a href="perfil.php?id='.$results["id"].'" nome="p"><br /><p nome="p"><h3>'.$results["nome"].' '.$results["apelido"].'</h3></p><br /></a><br /><hr /><br />';
}
}else{
echo "<br /><h3>Não foram encontrados resultados...</h3>";
}
}else{
echo "<br /><h3>Tens de escrever pelo menos 3 letras...</h3>";
}
?>
</body>