# -------------------------------------------------------------------- function show_table($order,$id,$npages,$nrows,$max_rows,$from,$to) { if ($to > $max_rows) $to = $max_rows - $from; # use mysql's "limit from,to" to select the correct rows $query = "select imagepath,title,description from pagination_images order by " . $order . " limit " . $from . "," . $to; $result = mysql_query($query) or show_error("Query failed: " . mysql_error()); $numrows=mysql_num_rows($result); if ($numrows > 0) { # create table with id = "media" echo "
Image | "; echo 'Title | ' . "\n"; echo 'Description | ' . "\n"; echo "
---|---|---|
"; echo " | " . $line['title'] . " | "; echo "" . $line['description'] . " | "; echo "