$dbhost = "www3.megaxus.com";
$dbuser = "megaxus2";
$dbpass = "m3g4w4t!m3r4h";
$dbname = "sandboxdb";
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);
$page = $_GET['page'];
if ($page == "")
{
$page = 1;
}
$a = ($page - 1) * 6;
$result = mysql_query("SELECT * from potof where OK=1 limit $a,6 ");
$x = 1;
while($row=mysql_fetch_array($result)) {
$id[$x] = $row[0];
$foto[$x] = $row[3];
$x = $x +1;
}
?>
$result = mysql_query("SELECT count(No) from potof where OK=1");
$tot = mysql_fetch_row($result);
$akhir = ceil($tot[0] / 6);
for($i=1;$i<=$akhir;$i++)
{
echo "
" . $i . " ";
}
?>