Unable to connect to the database server.

"); exit(); } if (!(@mysql_select_db($db_name))) // If can't connect to database, error and exit(). { echo("

Unable to locate the $db_name database.

"); exit(); } $limit= $_GET['limit']; if (!($limit)){ $limit = 10;} // Default results per-page. $page= $_GET['page']; if (!($page)){ $page = 0;} // Default page value. $numresults = mysql_query("SELECT * FROM comments WHERE live='l'"); // the query. $numrows = mysql_num_rows($numresults); // Number of rows returned from above query. if ($numrows == 0){ echo("No results found matching your query - $query"); // bah, modify the "Not Found" error for your needs. exit();} $pages = intval($numrows/$limit); // Number of results pages. // $pages now contains int of pages, unless there is a remainder from division. if ($numrows%$limit) { $pages++;} // has remainder so add one page $current = ($page/$limit) + 1; // Current page number. if (($pages < 1) || ($pages == 0)) { $total = 1;} // If $pages is less than one or equal to 0, total pages is 1. else { $total = $pages;} // Else total pages is $pages value. $first = $page + 1; // The first result. if (!((($page + $limit) / $limit) >= $pages) && $pages != 1) { $last = $page + $limit;} //If not last results page, last result equals $page plus $limit. else{ $last = $numrows;} // If last results page, last result equals total number of results. //escape from PHP mode. ?>
Comments - of
Page of
 
comments:
back \n");} for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it. { $ppage = $limit*($i - 1); if ($ppage == $page){ echo("$i \n");} // If current page don't give link, just text. else{ echo("$i \n");} } if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { // If last page don't give next link. $next_page = $page + $limit; echo(" next\n");} ?>

Enter your comment here:







Other Sites:

News:

Breaking Free. More and more mini website are going to start poping up now that we have our own webspace. If you have any ideas or would like to develop a web site please see TDW down in Media for more information.


Details:

Thomas Tallis School
Kidbrooke Park Road
Blackheath, London
SE3 9PX
Phone: (020) 8856 0115
Fax: (020) 8319 4715
Email: admin@thomastallis.greenwich.sch.uk
Thomas Tallis School
Thomas Tallis School - © 2008-2009, thomastallis.co.uk. Home | Contact | TDW WebSite Design | Site Map