TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Need some php/mysql help!

Page: 1 Reply
Jan 10th 2003#85379 Report
Member since: Sep 12th 2002
Posts: 28
Hello!

Lets say that I use a form to write in information to a mysql databse. And then i have a website displaying the info.

Now lets say that the PHP display the mysql information according to date, with the newest inscription on top. [Here comes the part I dont know:] Lets say that it I want 5 "displays" one the main page. And IF there are more than 5 mysql rows, I want the other ones to be displayed on new pages, with 5 on each. And they shall all be linked to eachother, with the oldest inscriptions on the last page.

How can the be done?

Thanks
Reply with Quote Reply
Jan 10th 2003#85392 Report
Member since: Jun 30th 2001
Posts: 447
The key to this lies in the mySQL query. Go to http://www.mysql.com and learn how to use LIMIT statements.
Reply with Quote Reply
Jan 11th 2003#85455 Report
Member since: Sep 12th 2002
Posts: 28
Ok, I guess there are no shortways
Reply with Quote Reply
Jan 11th 2003#85456 Report
Member since: Sep 12th 2002
Posts: 28
I know that I can use a simple SELECT * FROM xxxxxx ORDER BY xxxxx DESC LIMIT 5 to limit them to 5.

But I have read much of the manual, and still cant understand who to first make the code to determine if its more than 5 entries, and then "create" new pages for every pages.
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum