I am a beginner in php. I am trying to make an web application where users score is updated for every correct answer he answers. The script is as below
<?php
$username="surendra";
$useranswer=$_REQUEST['option'];
$qno=$_REQUEST['a'];
  $con=mysqli_connect("localhost","root","","gk");
// Check connection
  include('connection.php');
    $sql1="SELECT * FROM questions  WHERE  qid=$qno";
    $result=mysql_query($sql1);
while ($row = mysql_fetch_array($result))
{
    $correctanswer=$row['answer'];
}
   include('connection.php');
     $sql1="SELECT * FROM contest  WHERE  username LIKE '".$username."'";
     $result=mysql_query($sql1);
while ($row = mysql_fetch_array($result))
{
    $points=$row['points'];
}   
    if ($username=$correctanswer)
      {
         $con=mysqli_connect("localhost","root","","gk");
          // Check connection
       if (mysqli_connect_errno())
         {
          echo "Failed to connect to MySQL: " . mysqli_connect_error();
          }
        mysqli_query($con,"UPDATE contest SET points=$points+5
         WHERE username =$username");
          mysqli_close($con);
         }
  ?>
The update function is not working pls help me in this?
 
     
     
    