Thread: PHP database
View Single Post
  #1 (permalink)  
Old 07-14-2005, 02:14 PM
nikhiltechnology nikhiltechnology is offline
Senior Member
 
Join Date: May 2005
Location: Indore, India
Posts: 185
nikhiltechnology is on a distinguished road
iTrader: (0)
Default PHP database

Hello Friends

Here is a rough outline of what I'm trying to do I have a database that pulls from several tables to post a question and answer in a form format. the user then selects and answer and hits the submit button. The script will then tally the results and pop up a referance to the manual on where the answer can be found if the question is wrong and if correct continue on to the next question. Where the problem lies is pulling the next question upon user hitting the submit button general work flow is like the following.

1.Question printed through PhP scripting in form format
2.User input and submittal
3. Next question and answer set retrieved and printed in same window
4. end if end of records in the database

Now the problem I'm having is one I can do any inline scripting on the form action line like such


Code:
print ("<Form action ='<?php PrintQuestion($result) ?>' method = post>");


this simply pops up and error I also thought about doing a persistant connection to the data base and just putting my function in a seperate file so I could do a call like this.

Code:
print('<Form action = "calldatabase.php" method ="post">');


The problem with this is the database connection whether its permenint or not closes at the end of the script so all I would get would be the first record over and over again which dosent help my situation at all. I need to be able to pull one record wait for a response then pull the next record in sequence can anyone give me any advise on how to achieve this.

Thanks
Reguards
Nikhil
Reply With Quote