include "config.php"; $id = $_GET['id']; $db = connect (); ?> $sql = " SELECT * FROM foto where id like '$id' limit 1 " ; $result = mysql_query($sql, $db) ; if ($result > 0) ; else echo "Errore nella query"; ?> $sql1 = " SELECT * FROM foto where id like '$id' limit 1 " ; $result1 = mysql_query($sql, $db) ; if ($result1 > 0) ; else echo "Errore nella query this"; $row1 = mysql_fetch_array($result1); $sqlp = " SELECT * FROM foto where id < '$id' order by id desc limit 1 " ; $resultp = mysql_query($sqlp, $db) ; if ($resultp > 0) ; else echo "Errore nella query p"; $rowp = mysql_fetch_array($resultp); $sqln = " SELECT * FROM foto where id > '$id' limit 1 " ; $resultn = mysql_query($sqln, $db) ; if ($resultn > 0) ; else echo "Errore nella query n"; $rown = mysql_fetch_array($resultn); $sqlf = " SELECT * FROM foto order by id limit 1 " ; $resultf = mysql_query($sqlf, $db) ; if ($resultn > 0) ; else echo "Errore nella query n"; $rowf = mysql_fetch_array($resultf); $sqll = " SELECT * FROM foto order by id desc limit 1 " ; $resultl = mysql_query($sqll, $db) ; if ($resultn > 0) ; else echo "Errore nella query n"; $rowl = mysql_fetch_array($resultl); ?> while ($row = mysql_fetch_array($result)){ $title="$row[descrizione] - $row[autore] "; require "../top.php"?>
AUTORE: $row[autore] "; echo ""; echo " Altre foto dell'autore "; //echo ""; } ?> |