actually i am creating a online exam webapplication in php. and i m retrieving data from database .now the prob. is how to loop data by indexing one by one.. so user view one question at a time and after clicking on submit button it display the next question by from array. here i used array of all the rows and taking question one by one by javascript . but there is some prob. in javascript . i only render 1st question .. increment is not implementing correctly.
     <input type="hidden" value="<?php echo $i=0; ?>"  id="cc">
        <div id="counter">
        <p id="idIndex" name="id" value="<?php echo $findData[$i]['Exam']['id']; ?>"><?php echo $findData[$i]['Exam']['id']; ?>  </p>
        <p ><?php echo $findData[$i]['Exam']['que'];?></p>
        <input type="radio" value="<?php echo $findData[$i]['Exam']['op1']; ?>" name="op1" id="jaid" ><?php echo $findData[$i]['Exam']['op1']; ?>
        <input type="radio" value="<?php echo $findData[$i]['Exam']['op2']; ?>" name="op1" id="jai" ><?php echo $findData[$i]['Exam']['op2']; ?>
        <input type="radio" value="<?php echo $findData[$i]['Exam']['op3']; ?>" name="op1" id="jai"><?php echo $findData[$i]['Exam']['op3']; ?>
        <input type="radio" value="<?php echo $findData[$i]['Exam']['op4']; ?>" name="op1" id="jai" ><?php echo $findData[$i]['Exam']['op4']; ?>
        </div>
         <input type="submit" id="sub" onclick="myexam()" >
        <?php echo $this->Html->script('jquery-2.2.3.min'); ?>
        <script>
        function myexam(value)
        {
            var v=$("#cc").val();
        }
        </script>
 
    