display one question per page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
qumar
Forum Commoner
Posts: 29
Joined: Wed Nov 01, 2006 8:20 am

display one question per page

Post by qumar »

hi everybody,
i am doing the project on online exam.
in admin side, i created tests. each test has 5 questions.
i have created questions and choices. inserted into database.i finished the admin part. problem is userside.
in user side, one question should display per page and
press next button to go next page. at the end all
questions result should display.
please help me how can i do in user side.
and also gvie the sample website.

thanks,
qumar.
mentor
Forum Contributor
Posts: 100
Joined: Sun Mar 11, 2007 11:10 am
Location: Pakistan

Post by mentor »

You can use limit in MySQL query e.g.

Code: Select all

SELECT * FROM questions LIMIT 0,1
on next page

Code: Select all

SELECT * FROM questions LIMIT 1,1
and then

Code: Select all

SELECT * FROM questions LIMIT 2,1
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Search for 'pagination'. There are lots of posts for this around here.
Post Reply