...

View Full Version : Retrieve names from MYSQL



m@l@y@
09-01-2006, 12:04 PM
Hi Guyz wud you kindly assist!

1. Im tryin to retrieve the following names from the database

'kagiso', 'steve', 'dwele', 'raheem', 'raekwon', 'common'

2. i need to retrieve only 3 names @ a time
then echo a 'next >>' link that will retrieve the last three

============|===========|============|=======
Thanx in Advance!

guelphdad
09-01-2006, 01:47 PM
you would retrieve all six at once from your database and then use your PHP code to display 3 and then 3 more.

MRMAN
09-01-2006, 02:01 PM
you would retrieve all six at once from your database and then use your PHP code to display 3 and then 3 more.

Thats ok if there is only 6 names. But if you have 600 names and want to show 30 a page then you are puling a lot of data every time.

What i would to is use the LIMIT option on the mysql statement.

So if would be like this.


Select * FROM names LIMIT 0 , 3
this will select the first three;
then the second query would be

Select * FROM names LIMIT 3 , 3
This would select the 4th, 5th and 6th.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum