how to make previous and next Button Display Data in php

how to make previous and next Button Display Data in php

mysql_num_rows($rs)) { unset($_SESSION[qn]); exit; }*/ if(isset($subid) && isset($testid)) { $_SESSION[sid]=$subid; $_SESSION[tid]=$testid; header("location:quiz.php"); } if(!isset($_SESSION[sid]) || !isset($_SESSION['tid'])) { header("location: index.php"); } ?>

Online Quiz

$query="select * from mst_question";

$rs=mysqlquery("select * from mstquestion where testid=$tid",$cn) or die(mysqlerror()); if(!isset($_SESSION['qn'])) { $_SESSION['qn']=0; mysqlquery("delete from mstuseranswer where sessid='" . sessionid() ."'") or die(mysql_error()); $_SESSION['trueans']=0;

} else {
if($submit=='Next Question' && isset($ans)) { mysqldataseek($rs,$_SESSION['qn']); $row= mysqlfetchrow($rs); mysqlquery("insert into mstuseranswer(sessid, testid, quedes, ans1,ans2,ans3,ans4,trueans,yourans) values ('".sessionid()."', $tid,'$row[2]','$row[3]','$row[4]','$row[5]', '$row[6]','$row[7]','$ans')") or die(mysql_error()); if($ans==$row[7]) { $SESSION['trueans']=$SESSION['trueans']+1; } $SESSION['qn']=$SESSION['qn']+1; } else if($submit=='Get Result' && isset($ans)) { mysqldataseek($rs,$_SESSION['qn']); $row= mysqlfetchrow($rs); mysqlquery("insert into mstuseranswer(sessid, testid, quedes, ans1,ans2,ans3,ans4,trueans,yourans) values ('".sessionid()."', $tid,'$row[2]','$row[3]','$row[4]','$row[5]', '$row[6]','$row[7]','$ans')") or die(mysql_error()); if($ans==$row[7]) { $SESSION['trueans']=$SESSION['trueans']+1; } echo "

Result

"; $SESSION['qn']=$SESSION['qn']+1; echo "<Table align=center>Total Question $_SESSION[qn]"; echo "True Answer".$_SESSION['trueans']; $w=$SESSION['qn']-$SESSION['trueans']; echo "Wrong Answer ". $w; echo ""; datedefaulttimezone_set("Asia/Kolkata"); echo date('d/m/Y H:i:s'); //Returns IST

            mysql_query("insert into mst_result(login,test_id,test_date,score) values('$login',$tid,'".date("d-m-Y H:i:s")."',$_SESSION[trueans])") or die(mysql_error());
            echo "<h1 align=center><a href=review.php> Review Question</a> </h1>";
            unset($_SESSION['qn']);
            unset($_SESSION['sid']);
            unset($_SESSION['tid']);
            unset($_SESSION['trueans']);
            exit;
    }

} $rs=mysqlquery("select * from mstquestion where testid=$tid",$cn) or die(mysqlerror()); if($SESSION['qn']>mysqlnum_rows($rs)-1) { unset($_SESSION['qn']); echo "

Some Error Occured

"; session_destroy(); echo "Please Start Again";

exit; } mysqldataseek($rs,$_SESSION['qn']); $row= mysqlfetchrow($rs); echo "

";

echo "
"; echo " Quiz contains '".mysqlnumrows($rs)."' quetions

"; echo "
"; echo "
�  "; $n=$_SESSION['qn']+1; echo "
Que ". $n .": $row[2]"; echo "
$row[3]"; echo "
$row[4]"; echo "
$row[5]"; echo "
$row[6]";

if($_SESSION['qn']

"; else echo "
"; echo "
"; ?>

View Answers









Related Tutorials/Questions & Answers:
how to make previous and next Button Display Data in php
how to make previous and next Button Display Data in php  <?php..."); } ?> Online Quiz <?php include_once('include/home.php');<...; } else { if($submit=='Next Question' && isset($ans
next and previous record in php
next and previous record in php  How to display next and previous records in PHP
Advertisements
PHP Previous Next Page - PHP
PHP Previous Next Page  PHP Previous Next PageIs it possible to create dynamic navigation using PHP and MYSQL? DO I need to create a class to create the next, previous buttons in PHP? I?m digging for a small as well as handy code
How to use next and previous button(or href) for database table that is retrieved from MySQL DB.
How to use next and previous button(or href) for database table that is retrieved from MySQL DB.  Initially,display 7or10 records on a jsp pageand when click on the NEXT button(or href link) then display next 7 records
How to use next and previous button(or href) for database table that is retrieved from MySQL DB using jsp,jstl,javascript
How to use next and previous button(or href) for database table... button/link then it must display next 10 record from database and same for previous to display previous 10records. Database Query like this: Select * from table
How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST
How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST  How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST,please send answer as soo as possible
How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST
How to Display next Record from Database "On the Click of Next Button" USING... records in index form) to show next data on button click,so that it will goes to next list and sees the index and display another records Please reply. <
How to Display next Record from Database "On the Click of Next Button" USING ARRAYLIST
How to Display next Record from Database "On the Click of Next Button" USING... records in index form) to show next data on button click,so that it will goes to next list and sees the index and display another records Please reply. <
display data in php
display data in php  i want data validation in javascript for my form data and it will display in php. my fields are name,emailid,address,country combobox,state combo box, i want only php page,can u wxplain process how it come
How to Display Next question from database after clicking Next Button using "Arraylist concept"
How to Display Next question from database after clicking Next Button using "Arraylist concept"  </tr> <%if (pageName.equals("1")) {%> <tr> <td> <div style
to display NEXT and previous option after 10 entries in java
to display NEXT and previous option after 10 entries in java  As after jsp code we refer to java for connectivity and i want that directly only 10 entries will be open and next there will be pages. so what would i do for coding
Fetch the data from mysql and display it on php form
Fetch the data from mysql and display it on php form  when i press on login button, after succesful login the related data of that person should be display in other textbox
On Click on Submit Button Display Data on Orderlist
On Click on Submit Button Display Data on Orderlist  How can retreive data from database on orderlist on Click on submit Button of same page
How to display button as a link in vaadin?
How to display button as a link in vaadin?  Hello, I am working... a button. How to achieve this? Thanks   Hi, You can use the following code...: btnClickMe.setStyleName(BaseTheme.BUTTON_LINK); is used to make a button look like
How to make a button of different behaviour?
How to make a button of different behaviour?  Suppose In a jsp page I have a button SAVE with id="btnSave" value="SAVE" and a javascript function... of SAVE button will call ajaxInsertUpdateData(document.getElementByID("btnSave
how to display data in excel sheet?
how to display data in excel sheet?  According to the user Id,some... the button and to display the data in excel sheet... there will be a button called excel download,and if we click the button data
Output Previous or Next Day of the Month
Output Previous or Next Day of the Month   Please Help! I need... they want the next day or the previous day. E.g., the user would see: Enter todays... or previous day: The program should output the next day's or previous day's date
NEXT and PREVIOUS Records - JSP-Servlet
NEXT and PREVIOUS Records  Dear Sir, In my Project i have next... requirement next,previous buttons should be placed at top of the page as well. For Example: Previous Next sid sname addr 1
next button in servlet
next button in servlet  i want to add next,previous button to get next record in my servlet. can you explain the logic to do
How to make animated web button, make animated web button, animated web button
How to make animated web button       This is a web button animation example, it is a very simple to make with this example. I hope you will like it so follow now. New File: First
how to make a button left justification which is at right end
how to make a button left justification which is at right end  how to make a button left justification which is at right end thanks in advance
How to Make HTTP Requests Using Curl and Decoding JSON Responses in PHP
How to Make HTTP Requests Using Curl and Decoding JSON Responses in PHP  Make HTTP Requests Using Curl and Decoding JSON Responses in PHP   .... As a php developer, sometimes we need to get data from other server or need
files that are present in any folder , how to make it clickable downloadble file in php
files that are present in any folder , how to make it clickable downloadble file in php   files that are present in any folder , how to make it clickable downloadble file in php
php display errors
php display errors  i don't know how to display the error using PHP
how to display data from database in jsp
how to display data from database in jsp  how to display data from database in jsp
How to show next question from database on the click of next button..(Struts & Hibernate)
How to show next question from database on the click of next button..(Struts.... Problem.: When m clicking my next button it is not showing another question...++; } } %> next jsp called:flashPage.jsp <%-- Document : home
How to show next question from database on the click of next button..(Struts & Hibernate)
How to show next question from database on the click of next button..(Struts.... Problem.: When m clicking my next button it is not showing another question...; next jsp called:flashPage.jsp <
How to display the data column on jsp
How to display the data column on jsp  My requirements: Display total...; </form> It display the data of last database server... with this situtaion. should i set the data in a pojo and display the data in row wise
How to Display Data in a tree structure on the GUI
How to Display Data in a tree structure on the GUI  how to display data in a tree structure on the GUI? I need this sort of UI to display data showing a set of rules showing various conditions and the actions related
pass radio button values to next page
pass radio button values to next page  how to pass selected radio button values which coming from mysql database to next page using php. Please show me with examples
ModuleNotFoundError: No module named 'django-next-previous'
: No module named 'django-next-previous' How to remove the ModuleNotFoundError: No module named 'django-next-previous' error? Thanks   Hi...ModuleNotFoundError: No module named 'django-next-previous'  Hi
ModuleNotFoundError: No module named 'django-next-previous'
: No module named 'django-next-previous' How to remove the ModuleNotFoundError: No module named 'django-next-previous' error? Thanks   Hi...ModuleNotFoundError: No module named 'django-next-previous'  Hi
Getting Previous, Current and Next Day Date
Getting Previous, Current and Next Day Date   ... previous, current and next date in java. The java util package provides... helps you to get the previous, current and next date to Date() constructor
display all the values on next page
display all the values on next page  i am inserting values in the database through textboxes and dropboxes, when i am clicking on submit button those... doing some functionality on next page i am returning on my first page and i want
how to post data in mysql php form
how to post data in mysql php form  how to post data in mysql php form
How much does a data scientist make at Amazon?
How much does a data scientist make at Amazon?  Hi, I am beginner... to learn: How much does a data scientist make at Amazon? Try to provide me good... a data scientist make at Amazon?". Also tell me which is the good training
Date Next and Previous - Java Interview Questions
Date Next and Previous  In the example given here, DATE is displayed in DD/MM/YYYY format. Can anybody send me the code for getting DATE in MM/DD... StringToDate{ public static void main(String[] args){ try { String str_date 
how to display default radio button in struts2.0 for first time login - Struts
how to display default radio button in struts2.0 for first time login  hi, this is suresh jampala, i have one question regarding struts2.0,how can i display default radio button in struts2.0 when ever i loggedin first time
how to search data in xml files using php
and available on the server but I want to access it through php. How can I do this and how can I use PHP to allow them to search through, and then display...how to search data in xml files using php  So I want to create
how to display the values of one list in other upon clicking a button in struts2
how to display the values of one list in other upon clicking a button... in struts2.. I have a problem, I have to display the values of one list in other list upon clicking a button...Can any one provide me the sample code.. Hope
how to display the data from excel to webpage
how to display the data from excel to webpage  Hi, I need help on following I have a webpage contains a text box and a button(get), i give a value in text box such as serial no. like 4024 and by click on get button it should
on click button php
on click button php  Function in PHP for on click button
please give me solution how to display next page after 20 records ? - JSP-Servlet
please give me solution how to display next page after 20 records ?  ... previous next 11 12 13 14 15... previous next 21 22 23 24 25 26 27 28
How to Retrieve Data from Facebook Using PHP
How to Retrieve Data from Facebook Using PHP  is this link has right content regards that?? http://techpdf.co.cc/blog/how-to-retrieve-data-from-facebook-using-php
How to Retrieve Data from Facebook Using PHP
How to Retrieve Data from Facebook Using PHP  is this link has right content regards that?? http://techpdf.co.cc/blog/how-to-retrieve-data-from-facebook-using-php
How to Make a Pdf and inserting data
How to Make a Pdf and inserting data       In this tutorial you will learn how we can make a pdf file and how we can insert a data into the pdf file. This all
which query will be run for previous(button) question
which query will be run for previous(button) question   which query will be execute on previous button to view the previous questions . for example... button i got previous question. please provide me the answer
how to display data in List Or grid or in table in Jsp
how to display data in List Or grid or in table in Jsp   <%@page...(); } %> </body> </html> this is my jsp code i want to display String P Value in List GIrd or Table please help am able to Print display data
change database values when click next button on jsp page
change database values when click next button on jsp page  How to retrive database values rondomly and display jsp page ,when user click next and previous bottons change the values on jsp page
Display data
Display data  after successful login how i can fetch my account information from sql database

Ads