Erro de acentuação
to com 2 codigos aqi, um é o INDEX
e outro o search.
ta funcionando tudo beleza, só que ta dando pau de acento :/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="css/jquery-ui-1.8.5.custom.css" rel="Stylesheet" />
<style type="text/css">
body
{
background-color: #000;
color: #fff;
};
</style>
<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.8.5.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{
$('#auto').autocomplete(
{
source: "search.php",
minLength: 1
});
});
</script>
</head>
<body>
<p><input type="text" id="auto" /></p>
</body>
</html>
este e um, e o que pesquisa é :
<?php
$mysqli = new mysqli('localhost', 'celinone', 'neto/123gostoso', 'celinone_plug');
$text = $mysqli->real_escape_string($_GET['term']);
$query = "SELECT nome FROM agenda WHERE nome LIKE '%$text%' ORDER BY nome ASC";
$result = $mysqli->query($query);
$json = '[';
$first = true;
while($row = $result->fetch_assoc())
{
if (!$first) { $json .= ','; } else { $first = false; }
$json .= '{"value":"'.$row['nome'].'"}';
}
$json .= ']';
echo $json;
?>
ta tudo funcionando, menos acentuação :SDiscussão (7)
Carregando comentários...