Thursday, 15 March 2012

How to pass mysql data into radio button and use it at another page -



How to pass mysql data into radio button and use it at another page -

what trying here that, firstly building quiz platform using juz php , mysql, , have table question id, qestion, option1, option2, option3, option4 , answer, want pass questions , options mysql radio button , utilize inputed values @ result page

try hope work you

<script type="text/javascript" src="js/jquery-latest.min.js"></script> <script type="text/javascript"> $(function(){ $('.table').hide(); }); function next(number){ $('.table').hide(); $('#table'+number).fadein(100); } </script>

with in body

<?php $query = mysql_query("select * table_name order id"); $i = 1; while($row = mysql_fetch_array($query)){ ?> <table id="table<?php echo $i; ?>" class="table"> <tbody> <tr> <td class="1" id="td01" valign="top" > <?php echo $row['qestion']; ?> </td> </tr> <tr> <td id="td1" class="tdradio" valign="top"> <input type="radio" name="option" value="<?php echo $row['option1']; ?>"> </td> </tr> <tr> <td id="td2" class="tdradio" valign="top"> <input type="radio" name="option" value="<?php echo $row['option2']; ?>"> </td> </tr> <tr> <td id="td3" valign="top"> <input type="radio" name="option" value="<?php echo $row['option3']; ?>"> </td> </tr> <tr> <td id="td4" valign="top"> <input type="radio" name="option" value="<?php echo $row['option4']; ?>"> </td> </tr> <tr> <td class="question"> <?php echo $i; $i++; ?>/<?php echo mysql_num_rows($query); ?> </td> </tr> <tr> <td id="next"> <div class="next" onclick="next(<?php echo $i; ?>);"></div> </td> </tr> </tbody> </table> <?php } ?>

mysql

No comments:

Post a Comment