error_reporting(0);
$database="web2_db1";
$user="web2_u1";
$pass="from7733";
mysql_connect(localhost,$user,$pass) or die( "Unable to connect to database");
@mysql_select_db($database) or die( "Unable to select database");
// current/max values - set defaults if values aren't set
$cur = ($cur) ? $cur : 0;
$max = ($max) ? $max : 750;
// build a string of all variables that need to be passed from page to page
$passthrough = '&max='.$max;
// run query and echo out results
$sql = "SELECT image_id, image_name FROM 4images_images LIMIT $cur,$max";
$res = mysql_query($sql);
while ($row = mysql_fetch_array($res)) {
echo '
'.$row["image_id"].' - '.$row["image_name"].'';
}
// get total, and echo out paging links
$total = mysql_result(mysql_query("SELECT count(*) FROM 4images_images"),0);
$next = ($cur+$max < $total) ? 'next '.$max.' »' : 'next '.$max.' »';
$prev = ($cur-$max >= 0) ? '« previous '.$max.' ' : '« previous '.$max.' ';
echo '