$sel=4; include('conf.php'); // query per news selezionata if($_GET["id"]!=""){ $sql2 = "SELECT * FROM contents WHERE id = '$_GET[id]' order by ordine ASC"; } else { $sql2 = "SELECT * FROM contents WHERE id_tipo = '1' and lang ='".$_SESSION["LANG"]."' and stato='1' order by data_ins DESC limit 1"; } $res2 = mysql_query($sql2); $row2 = mysql_fetch_array($res2); $data = $row2["data_news"]; $anno = substr($data, 0,4); $mese = substr($data, 5,2); $giorno = substr($data, 8,2); $row2["data_news"] = $giorno . ".".$mese .".".$anno; $sqlIMG1 = "SELECT * FROM images WHERE id_rif = '".$row2["id"]."' order by ordine ASC LIMIT 1"; $rsIMG1 = mysql_query($sqlIMG1); $rowIMG1 = mysql_fetch_array($rsIMG1); ?>