Ristoranti a RomaRistoranti a RomaRistoranti in Italia
$db=mysql_connect ("localhost", "deltaf","251978");
mysql_select_db("deltaf");
mysql_set_charset('utf8');
mysql_query("SET NAMES 'UTF8'");
if (!isset($start) OR $start<0)
$start=0;
$step =20;
$city = strtolower($city);
$city = ucfirst($city);
if ($city!=""){
$query_ext.=" AND (città ='$city' or provincia='$city')";}
else{
$query_ext.="";}
if ($nome!=""){
$query_ext.=" AND nome like '%".$nome."%'";}
else{
$query_ext.="";}
if ($tipo!=""){
$query_ext.=" AND tipo_ristorante like '%".$tipo."%'";}
else{
$query_ext.="";}
if ($zona!=""){
$query_ext.=" AND zona like '%".$zona."%'";}
else{
$query_ext.="";}
if ($celiaci!=''){
$query_ext.=" AND celiaci='s'";
}
else
{
$query_ext.="";
}
if ($prezzofisso!=''){
$query_ext.=" AND prezzofisso='s'";
}
else
{
$query_ext.="";
}
if ($etici!=''){
$query_ext.=" AND etici='s'";
}
else
{
$query_ext.="";
}
if ($romantic!=''){
$query_ext.=" AND romantic='s'";
}
else
{
$query_ext.="";
}
if ($musei!=''){
$query_ext.=" AND musei='s'";
}
else
{
$query_ext.="";
}
if ($bambini!=''){
$query_ext.=" AND bambini='s'";
}
else
{
$query_ext.="";
}
if ($dintorni!=''){
$query_ext.=" AND dintorni='s'";
}
else
{
$query_ext.="";
}
if ($gruppi!=''){
$query_ext.=" AND gruppi='s'";
}
else
{
$query_ext.="";
}
if ($lusso!=''){
$query_ext.=" AND lusso='s'";
}
else
{
$query_ext.="";
}
$sel=mysql_query("select * from ristorazione where (ID!='' and nome!='') $query_ext order by nome asc limit $start,$step");
echo mysql_error();
//echo "select * from ristorazione where (ID!='') $query_ext order by nome asc limit $start,$step";
echo "Ristorazione a Roma e provincia: ";
echo "
";
/* Fine della tabella */
echo "\n";
/* Chiude la connessione al server */
echo "
\n";
/////////////////////SELEZIONE ATTRAVERSO IL TIPO ///////////////////////////////
////////////////////////////////////////////FINE SELEZIONE ATTRAVERSO L'ID ////////////////////////////////
$query = "SELECT count(*) AS tot FROM ristorazione WHERE ID!='' $query_ext";
$result = mysql_query($query, $db);
$row = mysql_fetch_array($result);
$pages = intval(($row[tot]-1) / $step)+1;
echo "