THis is my code
<?php
include 'config.php';
//Check if the page number is defined else set it to one. Standard Procedure. :)
if(!isset($_GET['page'])){
$page = 1;}
else {$page = $_GET['page'];
}
//Calclate the offsets
$from = (($page * $max_results) - $max_results);
// Creat the query to be performed and then perform it.
$sql = mysql_query("$query_list LIMIT $from, $max_results");
// pre_result output
echo $pre_result;
while($row = mysql_fetch_array($sql)){
?>
However i only want to select items which have a trip_id of 1 for example... how do i add this??
This is the bottom of the code
<?php
$bgcolor = ($bgcolor == $bgcolor1) ? $bgcolor2: $bgcolor1; //for altering background color.
}
//post_result outpur
echo $post_result;
// Calculate the total number of results.
$total_results = mysql_result(mysql_query("SELECT COUNT($fields) as Num FROM $table"),0);
// Calculate the total number of pages. ceil() is used to round the page number to the higher integer.
$total_pages = ceil($total_results / $max_results);
// The real stuff. Creats the Navigation Menu
//Set font style for navigation area
echo "<div class=\"text\"><center>$nav_title<br>";
// Create the Previous link.
if($page > 1){
$prev = ($page - 1);
echo "<a class=\"nav\" href=\"".$_SERVER['PHP_SELF']."?$httpvar=$prev\"><font size=\"2\" face=\"Verdana\" color=\"#000000\">$pre_style</a> ";
}
//Creat the navigation page numbers.
for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){ // make sure the link is not given to the page being viewed
echo "$i ";
} else {
echo "<a class=\"nav\" href=\"".$_SERVER['PHP_SELF']."?$httpvar=$i\"><font size=\"2\" face=\"Verdana\" color=\"#000000\">$i</a> ";
}
}
// Create the next link.
if($page < $total_pages){
$next = ($page + 1);
echo "<a class=\"nav\" href=\"".$_SERVER['PHP_SELF']."?$httpvar=$next\"><font size=\"2\" face=\"Verdana\" color=\"#000000\">$next_style</a>";
}
echo "</center></div>";
echo $post_nav;
?>