Salve vorrei inserire nella mia pag. downloads.php un sistema x la numerazione delle pag. ho l'etto la guida nel sito ma nn ci sn riuscito cmq...
la tabella si chiama downloads
l'errore è questo:
Notice: Use of undefined constant tot - assumed 'tot' in c:\programmi\easyphp1-7\www\delex.it\downloads.php on line 129
Notice: Use of undefined constant tot - assumed 'tot' in c:\programmi\easyphp1-7\www\delex.it\downloads.php on line 141
grazie....
<table width=90% border=0><tr>
<td width=20% align=left>
<?
if (!isset($start) OR $start<0)
$start=0;
$step = 3;
if ($start>0)
{ $start_back = $start - $step;
echo "<a href=all.php?start=$start_back>precedenti</a>";
}
?>
</td>
<?
$query = "SELECT count(*) AS tot FROM downloads";
$result = mysql_query($query, $connetti);
$row = mysql_fetch_array($result);
$pages = intval(($row[tot]-1) / $step)+1;
?>
<td width=60% align=center>
<?
for ($i=0; $i<$pages AND $i<20; $i++)
{ $start_page = $i * $step;
echo "<a href=all.php?start=$start_page>" . ($i+1) . "</a> ";
}
?>
</td>
<td width=20%>
<?
if ($start + $step < $row[tot])
{ $start_next = $start + $step;
echo "<a href=downloads.php?start=$start_next>successivi</a>";
}
?>


Rispondi quotando
