Ciao a tutti,
qualcuno potrebbe spiegarmi perchè , dopo esser passato da php4 a php5, il mio script di paginazione non funziona più??
Con php4 funzionava alla grande...posto un riassunto:
//I DATI ARRIVANO DA UN FORM GET
$location = $_GET['location'];
if ($location == '-1') { unset($location); }
if(isset($_GET['id']));
{
$id = $_GET['id'];
$query = "SELECT thumb_Path FROM photoinfo WHERE id = '$id' ORDER BY id";
$result = mysql_query($query) or die('Error, query failed');
list($thumb_Path) = mysql_fetch_array($result);
readfile($thumb_Path);
}
@$limit=$_GET['limit'];
if(!isset($offset)) {
$offset = 0;
}
$eu = ($offset - 0);
if(!$limit > 0 ){
$limit = 2;
}
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
if (isset($location)) {
$query2=" SELECT * FROM photoinfo WHERE location='$location' ";
$result2=mysql_query($query2);
echo mysql_error();
$nume=mysql_num_rows($result2);
$where = "&location=$location";
}else {
$query2=" SELECT * FROM photoinfo ";
$result2=mysql_query($query2);
echo mysql_error();
$nume=mysql_num_rows($result2);
$where = "&mainsearch=$mainsearch";
}
if(isset($location)) {
$query=" SELECT * FROM photoinfo WHERE location='$location' limit $eu, $limit ";
$result=mysql_query($query);
echo mysql_error();
} else {(isset($mainsearch) and $mainsearch=="search");
$query=" SELECT * FROM photoinfo ORDER by id DESC LIMIT $eu, $limit ";
$result=mysql_query($query);
echo mysql_error();}
if(mysql_num_rows($result) == 0)
{
echo "<b>Database is empty</b> <br>";
} else {
$i=0;
$l=1;
$nav =' ';
for($i=0;$i < $nume; $i=$i+$limit){
if ($i <> $eu)
{
$nav .= " <a href='$page_name?offset=$i&limit=$limit&where=$where'>$l</a> ";
} else {
$nav .= "<font color=white>$l</font>";}
$l=$l+1;
}
while(list($location ) = mysql_fetch_array($result)) {
//LOOP
}
Grazie in anticipo