title: UPDATE OOP PDO PROBLEMS
body: <p>I am pretty new to OOP and PDO and I am having problems with my function. Whenever I click on the update button it doesn't update but rather creates a new member for me.</p>
  
  <pre><code>public function updateAll($data){
  
     try {
  
          $r = $this-&gt;db-&gt;query("UPDATE addmember SET(
              Pic = '".$data[0]."',
              Firstname= '".$data[1]."',
              Lastname= '".$data[2]."',
              Age= '".$data[3]."',
              Gender= '".$data[4]."',
              Phonenumber='".$data[5]."',
              Location='".$data[6]."',
              Member='".$data[7]."',
              Department='".$data[8]."'
  
              WHERE id='".$data[9]."'
  
              )");
         if ($r) {
            return true;
         }
         else{
           return false;
         }
  
     } catch (PDOException $e) {
  
          echo $e-&gt;getMessage();
  
     }
  
  }
  </code></pre>