I am creating a small project to explain my students on how to update values in SQL database using PHP code. I have created table in MySQL with all the fields as VARCHAR. I have written the following code which throws following error :
Error in Updting valueYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Mbps WHERE dsl = '25610669'' at line 1 where 25610669 is an existing record in the database. Here is the code:

```
<?php
    if((isset($_POST['B2'])))
    {
     $server = 'localhost' ;
      $un = 'root' ;
      $pass = 'icsk' ;
      $db = 'yusuf' ;
     $conn = mysqli_connect($server, $un, $pass, $db);
    $update = "UPDATE homereg SET Fname = {$_POST['First']}, Lname = {$_POST['Last']}, cid = {$_POST['cid']}, pack = {$_POST['choice']} WHERE dsl = {$_POST['dsl']}" ;
    $result = mysqli_query($conn, $update);
    if($result == 1)
      { 
         echo "Successfully Updated" ; 
      }
    else
      {
         echo "Error in Updting value" . mysqli_error($conn)  ;
      }
    }

    ?>
    <html>
    <head>
    <title>Update User Information</title>
    </head>
    <body background="HomePageMap.gif">
    <CENTER><B><FONT COLOR = 'RED'>SEARCH & UPDATE THE EXISTING RECORD HERE </FONT></B></CENTER><P>
    <form method="POST" action="modify.php" name = "frm">   
        <div align="center">
            <table border="1" width="314">
                <tr>
                    <td width="130"><b>DSL Number</b></td>
                    <td width="168"><input type="text" name="dsl" size="20"></td>
                </tr>
                <tr>
                    <td width="130"><b>First Name</b></td>
                    <td width="168"><input type="text" name="First" size="20"></td>
                </tr>
                <tr>
                    <td width="130"><b>Last Name</b></td>
                    <td width="168"><input type="text" name="Last" size="20"></td>
                </tr>
                <tr>
                    <td width="130"><b>Civil ID</b></td>
                    <td width="168"><input type="text" name="cid" size="20"></td>
                </tr>
                <tr>
                    <td width="130"><b>Net Pack</b></td>
                    <td width="168"><select size="1" name="choice">
                    <option value = "2 Mbps">2 Mbps</option>
                    <option value = "5 Mbps">5 Mbps</option>
                    <option value = "10 Mbps">10 Mbps</option>
                    <option value = "15 Mbps">15 Mbps</option>
                    </select></td>
                </tr>
            </table>
        </div>
        <p align="center"><input type="submit" value="Search" name="B1">&nbsp;&nbsp;
        <p align="center"><input type="submit" value="Modify" name="B2">&nbsp;&nbsp;
        <input type="reset" value="Reset" name="B2"></p>
    </form>
    <p align="center">&nbsp;</p>
    </body>

    </html>

```