View Single Post
Old 01-07-2007, 06:10 AM   #1 (permalink)
markster
Code Monkey
 
markster's Avatar
 
Join Date: Jun 2006
Posts: 65
markster is on a distinguished road
Question How can i make php do this?

im making a jokes website and one of the pages is jokes.pho?cat=4 which will display all jokes with the category set as 4. the code so far is:

PHP Code:
<?php
require_once("mysql_connect.php");
$query "SELECT * FROM jokes WHERE cat=$cat ORDER BY id DESC";
$result mysql_query($query);
## CODE THAT DISPLAYS THE RESULTS IN A TABLE ##
?>
what im trying to make is a system that counts how many jokes in that category, and displays links that will be like:

view: 1-20, 21-40, 41-60

but it will need to auto figure out how many links it will need to produce and link them to a page like:

jokes.php?cat=4&selection=1,20

please help!
markster is offline   Reply With Quote