TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-20-2009, 05:40 AM   #1 (permalink)
skp
The Visitor
 
Join Date: Jul 2009
Posts: 2
Thanks: 1
skp is on a distinguished road
Default A doubt on PHP Online Quiz

I just wanted to develop a web application - an online quiz, in which i need to fetch questions only once & display one at a time as the user clicks the NEXT button. But, in php ,i guess it is difficult to have the questions(data) stored & use it on the event basis(button click)(since its a mere script invocation). Whereas , in asp.net it is easily done, since the data fetched can be stored till the user ends appln. So can u suggest some ways to do it in php......? or asp.net is the only way...?
skp is offline  
Reply With Quote
Old 07-20-2009, 06:11 AM   #2 (permalink)
The Acquainted
 
Hightower's Avatar
 
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
Hightower is on a distinguished road
Default

Quote:
Originally Posted by skp View Post
I just wanted to develop a web application - an online quiz, in which i need to fetch questions only once & display one at a time as the user clicks the NEXT button. But, in php ,i guess it is difficult to have the questions(data) stored & use it on the event basis(button click)(since its a mere script invocation). Whereas , in asp.net it is easily done, since the data fetched can be stored till the user ends appln. So can u suggest some ways to do it in php......? or asp.net is the only way...?
I would probably store the used questions in an array (the id of each question). This can then be easily checked to make sure the question is notused twice, and also can easily be used to recall all questions/answers at the end.
__________________
Hightower's Softpolio
Send a message via MSN to Hightower
Hightower is offline  
Reply With Quote
The Following User Says Thank You to Hightower For This Useful Post:
skp (07-20-2009)
Old 07-20-2009, 06:18 AM   #3 (permalink)
skp
The Visitor
 
Join Date: Jul 2009
Posts: 2
Thanks: 1
skp is on a distinguished road
Default

Thansk for ur reply. but i want to mak my question clear. Whether can i avoid database retrieval each time for each question for each user , wich wud mak the appln more loaded one & slow . ( for ref- in ASP.net, VB.net, as they are appln oriented, its enuf if DB Query fetch is made only once & can be displayed one at a time by moving the ADO like recordset pointer) So , is it possible to do something lik tht in php..? I wanted to reduce laod on DB engine(MySql).
skp is offline  
Reply With Quote
Old 07-20-2009, 07:09 AM   #4 (permalink)
Super Moderator
Inquisitive 
 
codefreek's Avatar
 
Join Date: Sep 2007
Location: Near you.
Posts: 791
Thanks: 241
codefreek is on a distinguished road
Default

Please don't post the same thread in 2 different sections.


-Cf
codefreek is offline  
Reply With Quote
Old 07-20-2009, 07:19 AM   #5 (permalink)
The Acquainted
 
Hightower's Avatar
 
Join Date: May 2009
Location: Durham, UK
Posts: 134
Thanks: 9
Hightower is on a distinguished road
Default

Quote:
Originally Posted by skp View Post
Thansk for ur reply. but i want to mak my question clear. Whether can i avoid database retrieval each time for each question for each user , wich wud mak the appln more loaded one & slow . ( for ref- in ASP.net, VB.net, as they are appln oriented, its enuf if DB Query fetch is made only once & can be displayed one at a time by moving the ADO like recordset pointer) So , is it possible to do something lik tht in php..? I wanted to reduce laod on DB engine(MySql).
That's possible too. Retrieve all the questions/answers you want you want and display the row (as in recordset).

Pseudo would be something like:

Get all questions/answers from db
Set a counter i.e. i = 0
Show the first row using counter
When submitted increase counter, so the next row (question/answer) is shown.
__________________
Hightower's Softpolio
Send a message via MSN to Hightower
Hightower is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM
what are all the subjects in php? sarmenhb General 7 01-21-2008 05:41 PM
PHP Quiz - What did you get? Wildhoney General 39 11-30-2007 09:21 PM


All times are GMT. The time now is 06:40 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design