473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Retrieve saved data from database

i have a project for online exam where we are providing tests in the following format
PAGE1
---------------
1.QUESTION
a.ans1
b.ans2
c.ans3
d.ans4
NEXT
------------------
on clicking the button "NEXT" it jumps to a second page with 2.QUESTION.i am not able to fetch the answer selected by the user to the user to PAGE 2 to calculate the score and display as YOUR SCORE: 0 OR 1
our work environment is ubuntu.
we are using PHP,and oracle database


my respective coding:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Que1</title>
  4.  
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <link rel="stylesheet" type="text/css" href="rghtstyle.css" />
  7.  
  8.  
  9. </head>
  10. <body>
  11.       <div id="container">
  12.                 <div id="header">
  13.                         <h1><font size="22">HTN<span class="off">bench</span></font></h1>
  14.                         <h2></h2>
  15.         </div>
  16.  
  17. <form action="c2.php" method="post">
  18. <?php
  19. include('/usr/share/moodle/lib/adodb/adodb.inc.php');
  20. function InvokeErrorHandler(){
  21. global $db; ## assume global 
  22.         print_r($db->ErrorNo());
  23.         print_r($db->ErrorMsg());
  24. print_r("PHP to ORCALE error");
  25. }
  26. $db = NewADOConnection("oci8");
  27. if(!$db->connect('192.168.0.1:1521','htnbench','induzhtn','orcl')) InvokeErrorHandler();
  28. $rs =$db->Execute("select * from clang where quesno=1");
  29. ?>
  30. <?php
  31. while(!$rs->EOF){
  32. print_r($rs->fields[0].' '.$rs->fields[1].'<br>' );?>
  33. <?php 
  34. $a=$rs->fields[2];
  35. $b= $rs->fields[3];
  36. $c=$rs->fields[4];
  37. $d=$rs->fields[5];
  38. ?>
  39. <p>
  40.         <input type="radio" name="ans" value=""/> <?php print_r($a.'<br>' ); ?>
  41. <p>
  42.         <input type="radio" name="ans" value=""/> <?php print_r($b.'<br>' ); ?>
  43. <p>
  44.         <input type="radio" name="ans" value=""/> <?php print_r($c.'<br>' ); ?>
  45. <p>
  46.         <input type="radio" name="ans" value=""/> <?php print_r($d.'<br>' ); ?>
  47.  
  48. <?php
  49. $rs->MoveNext();
  50. echo "<hr>";
  51. }?>
  52. <center><input name="" type="submit" value="Next" /></center>
  53. </form>
  54. </body>
  55. </html>
Oct 12 '11 #1
2 1710
Rabbit
12,516 Expert Mod 8TB
Your radio buttons have no values so it's not going to pass anything.
Oct 12 '11 #2
onselect of the answer is the form submitted if so u can collect the option selected to a table that relates questions to option the user selected before u load the new question
Oct 13 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jake_adl | last post by:
Is there any way to create a Microsoft.Practices.EnterpriseLibrary.Data.Database object without reading from a configuration file? I am writing a utility that manages databases in SQL Server....
0
by: Jon Paal | last post by:
--dropdownlist value isn't being saved to database from FORMVIEW --field PriorityID is datatype "number" (integer) what's missing ???? '=========code============= <asp:Content ID="Content1"...
0
by: msEMMA | last post by:
Hi, Im very new to programming and need to be able to as my assignment says: Q1 The user may elect at any time to save the data, ie item number, item description, opening date, opening price to...
1
by: prajin | last post by:
i have to retrieve hidden data from gridview. hidden data is Usr_No. then i need to update the record based on that condition. now i am getting the hidden data. but only first record is...
0
by: serghei | last post by:
I have already the insert form and the database. It's working to insert multiple data with multiple checkboxes. But I can't retrieve multiple data.
3
by: STEPHENSS | last post by:
Hi, I have a crystal report that has many subreports over many pages and Iam getting the following error Unable to save data with report, the save data is incomplete generate the saved data Yes...
2
by: ganesandeiav | last post by:
Dear sir how to retrieve a data that has been selected using combo box using jsp
10
by: puT3 | last post by:
I want to get the value from Product_Price field which it will display it record on a text box based on a product that is selected from a list box. Product Table Product_ID Product_Name...
0
by: ajjukumar | last post by:
Can any one tell me how to retrieve values from database? i got the column names of the table but i don't know how to get the particular value from data base this is my code submit.jsp: <html> ...
1
by: shaikabid | last post by:
sir/madam how to retrieve the data from a datagrid into textbox at run time in c# of web based applications... plz reply
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.