PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Nov 21, 2018 1:57 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Apr 03, 2017 3:08 pm 
Offline
Forum Newbie

Joined: Thu Jan 26, 2017 11:36 pm
Posts: 17
Location: Karachi
hi there i have learned alot from this place need more help i am generating radio buttons through array while fetching data from mysql . ihave done that successfully but not able to select options among the questions this is mcq quiz which has three options and a question when i select option 1 from question 1 question 2 gets unselected can any one point that minor mistake
Syntax: [ Download ] [ Hide ]

$sql = 'SELECT * from question_1  ';
$result=mysqli_query($conn,$sql)


?>
<table width=10% cellspacing="1">

<?php while ($rows = mysqli_fetch_array($result)){ ?>
 
            <label for="q1">Q1 <?php echo $rows['q1'];?>?</label><br>
                        <id= value="<?php echo $rows['q1'];?>">
                        <br>
                        <?php for($i=1; $i<=1; $i++)
                        {      
                        ?>
                        <?php for($i=1; $i<=1; $i++) {?>
                       
                        <?php echo '<input type="radio" name="option30" id="$i" value="1">'; echo $rows['option1'].$i;?> <br>
                        <?php for($i=1; $i<=1; $i++)?>
                        <?php echo '<input type="radio" name="option31" id="$i" value="0">';  echo $rows['option2'].$i;  ?> <br>
                        <?php for($i=1; $i<=1; $i++)?>
                        <?php echo '<input type="radio" name="option32" id="$i" value="2">';  echo $rows['option3'].$i;  ?> <br>
                        <br>
                        <?php
                        }
                        ?>
                        <?php
                        }
                        ?>
                        <?php }?>
<?php //endwhile;
                       
?>
                        <?php mysqli_close($conn); ?>



 


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group