title: SQL, PHP update query error
body: <p>I have some PHP code and I'm trying to insert or to update data in a MySQL table.</p>
  
  <p>The insert query works, but the update query doesn't. The values are printed correctly at the end.</p>
  
  <pre><code>&lt;?php
    $nm=$_GET["nm"];
    $reg=$_GET["regno"];
    $con=mysql_connect("localhost","root","admin");
    mysql_select_db("Q14",$con);
  
  
    // $res=mysql_query("insert into stdtable values('$nm','$reg')",$con);
  
    $res=mysql_query("UPDATE stdtable SET `NAME`='$nm',`REG NO`='$reg' WHERE 
    'REG NO'='$reg'",$con);
  
    echo "SUCCESS";
  
    echo $nm.$reg;
  ?&gt;
  </code></pre>