how to make previous and next Button Display Data in php

Ads
 

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

Ads









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. <
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
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
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
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
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 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
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
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
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... the previous, current and next date to Date() constructor of java.util package
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 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 <
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
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
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 from database in jsp
how to display data from database in jsp  how to display data from database in jsp
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
how to post data in mysql php form
how to post data in mysql php form  how to post data in mysql php form

Ads