RE: [PHP-DB] howw do I programm a PREV & Next mechanism in PHP? Help Please!!

From: Date: Thu, 04 Oct 2001 21:07:25 +0000
Subject: RE: [PHP-DB] howw do I programm a PREV & Next mechanism in PHP? Help Please!!
References: 1  Groups: php.db php.general 
Request: Send a blank email to php-db+get-13013@lists.php.net to get a copy of this message
This is a copy of the next/prev links I've used on my own News Droid project, to see an example, http://www.subject-unknown.com/phantom/ function NavLinks($limit, $offset, $user, $passwd, $dbname, $host, $PHP_SELF) { // Get a running total of news-id's so we can calculate and display $connection = @mysql_connect($host, $user, $passwd) or die (mysql_error()); $db = @mysql_select_db($dbname, $connection) or die (mysql_error()); $sql = " SELECT id from $tablename "; $result = @mysql_query($sql, $connection) or die (mysql_error()); $row_num = mysql_num_rows($result); $total = ($row_num-1); $next = $offset + $limit; $prev = $offset - $limit; $offset += $limit; -----Original Message----- From: Sander Peters [mailto:S.Peters@Visionnet.nl] Sent: Thursday, October 04, 2001 3:44 PM To: php-db@lists.php.net; php-general@lists.php.net Subject: [PHP-DB] howw do I programm a PREV & Next mechanism in PHP? Help Please!! Hello! I'm making a database wich can be viewed and modified through a webbrowser using PHP and MySQL. I users wants to browse records from my (mysql) database, and the user can decide how many records he/she wants to see per page. There should be a Previous and a Next button on each page to brows through the records. (This is a very common situation wich is for example used by search engines.) My problem is, I really don't know how to make a Prev and Next system. I tried already a lot but it doesn't work. Does somebody have a PHP script with this working and can you send it to me please (or just the part with the prev/next meschanism)? It would help me a lot! Thanks in advance! Greetings Sander Peters - The Netherlands http://www.visionnet.nl/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#13013) next »