pouet.net/search_suggest.php

16 lines
415 B
PHP
Raw Normal View History

2013-05-07 14:20:08 -04:00
<?
include_once("include/misc.php");
include_once("include/auth.php");
conn_db();
$r = mysql_query("select name,type,party_year from prods where name like '".mysql_real_escape_string($_GET["what"])."%' order by views desc limit 10");
$res[0] = $_GET["what"];
while($o = mysql_fetch_object($r))
2013-05-07 14:20:08 -04:00
{
$res[1][] = $o->name;
$res[2][] = $o->type.($o->party_year?", ".$o->party_year:"");
}
2013-05-07 14:20:08 -04:00
echo json_encode($res);
?>