RE: [PHP] Links script

From: Date: Sun, 07 Jan 2001 21:11:54 +0000
Subject: RE: [PHP] Links script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-33120@lists.php.net to get a copy of this message
What database? If you are using MySQL, use the LIMIT option in the select. http://www.mysql.com/documentation/mysql/commented/manual.php?section=SELECT Cal http://www.calevans.com -----Original Message----- From: James, Yz [mailto:liljim@btconnect.com] Sent: Sunday, January 07, 2001 3:01 PM To: php-general@lists.php.net Subject: [PHP] Links script Hey there, I am currently writing a links script which I'd like to list links stored in a MySQL database. Links can be submitted by the client, etc etc. That's not where my problem lies. At the moment we limit the client to 20 links per page. So, when thre links database reaches over 20 links, I'd like the first page to display the last 20 links (added by date), and then automatically insert a "Next page" link, which will take you to another page with the next 20 links. If the links amount to 40 or more, I'll need a "Back button" to take them back through the pages. I am garbling. Bah. Basically, what I guess I am asking is, how do I get the links pages to read rows from the database in chunks of 20? I know it'll be using LIMIT, but I don't want to have to write into the links script a load of if statements (I'm not too hot on For and While statments yet) which read <? if ($num_rows > 20) { echo "<a href=\"links.php?limit21,40\">Next 20 links</a>" } ?> etc etc. Sorry for the useless explanation, but hopefully one of you will gather roughly what I am saying. Thanks, James. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#33120) next »