how can i send form values to MYSQL database using php
i am sending the answer values to answer table for that i write the following code please see once and let me know where i am doing the mistake i am new to php.i want add the question number and answer values to the table .
    
        <?php  
            //connects to database  
            $con = mysql_connect("localhost","root",""); 
            if (!$con)  
            {  
            die('Could not connect: ' . mysql_error());  
            }  
                mysql_select_db("appulentoweb", $con);  
    
            //retrieve data from database  
            $result = mysql_query("SELECT * FROM questions"); ?>
     <form action="questioned.php" method="post">
           <table>
               <tr>
                  <th> QNo</th>
                  <th> QTitle </th>
                  <th> QAnswer </th>
               </tr>
            <?php 
            while($row=mysql_fetch_array($result))
            {
             ?>
             <tr>
                <td><?php echo $row['qid'];?></td>
                <td><?php echo $row['qdesc'];?></td>
                <td><input type="text" name="answervalue" /></td>
               </tr>
    <?php  
    $sql="INSERT INTO mobilestrgy (qno,response) VALUES ('$_POST[qid]','$_POST[answervalue]')";
    
    ?>
    <?php } ?>
    </table>
    
    <input type="submit" value="Submit"/>
    
    </form>

 i want submit the data to database please see my code and help me to achieve this.
    Thanks in Advance......


how can i send form values to MYSQL database using php
===

i am sending the answer values to answer table for that i write the following code please see once and let me know where i am doing the mistake i am new to php.i want add the question number and answer values to the table .
    
        <?php  
            //connects to database  
            $con = mysql_connect("localhost","root",""); 
            if (!$con)  
            {  
            die('Could not connect: ' . mysql_error());  
            }  
                mysql_select_db("appulentoweb", $con);  
    
            //retrieve data from database  
            $result = mysql_query("SELECT * FROM questions"); ?>
     <form action="questioned.php" method="post">
           <table>
               <tr>
                  <th> QNo</th>
                  <th> QTitle </th>
                  <th> QAnswer </th>
               </tr>
            <?php 
            while($row=mysql_fetch_array($result))
            {
             ?>
             <tr>
                <td><?php echo $row['qid'];?></td>
                <td><?php echo $row['qdesc'];?></td>
                <td><input type="text" name="answervalue" /></td>
               </tr>
    <?php  
    $sql="INSERT INTO mobilestrgy (qno,response) VALUES ('$_POST[qid]','$_POST[answervalue]')";
    
    ?>
    <?php } ?>
    </table>
    
    <input type="submit" value="Submit"/>
    
    </form>

 i want submit the data to database please see my code and help me to achieve this.
    Thanks in Advance......

