<?php
include("../configuracao.php");//confirma no banco de dados/

$mysqli = new mysqli($servidor, $usuario, $senha, $banco);

print $query;

if (mysqli_connect_errno())
{
die(mysqli_connect_error());
exit();
}
$mysqli->query("SET NAMES 'utf8'");

if(isset($_GET['term']))
{
$q = $mysqli->real_escape_string($_GET['term']);
$buscar = str_replace(" ","%",$q);

$sql = $mysqli->query("SELECT * FROM servicos WHERE titulo LIKE  '%Foto%'") or die(mysql_error());

	while ($row = $sql->fetch_assoc()) {
		$data[] = array(
			'label' => utf8_decode($row['titulo']),
			'titulo' => utf8_decode($row['titulo']),
			'valorvenda' => $row['valorvenda'],			
			'idservico' => $row['idservico'],
		);
    }
echo json_encode($data);
}

?>