title: Update query updates all rows in database instead of particular row
body: <p>I am new to Zend framework and I am trying to update data in database and grid, but instead of updating particular row all rows are getting updated. please help me with this.</p>
  
  <p>Here is my controller code.</p>
  
  <pre><code>public function editAction()
  {
  
  $form = new Application_Form_user();
  $this-&gt;view-&gt;form = $form;
  
  if($this-&gt;getRequest()-&gt;isPost())
  {
  
  $formData= $this-&gt;getRequest()-&gt;getPost();
  
  if($form-&gt;isvalid($formData))
  {
      $client= new Application_Model_DbTable_Client();
      $firstname = $formData['firstname'];
      $lastname = $formData['lastname'];
      $email = $formData['email'];
  
      $client-&gt;updateClient('Id',$firstname,$lastname,$email);
  
      $this-&gt;_helper-&gt;redirector('index');
  }
  else 
  {
      $form-&gt;populate($formData);
  
  }
  }
  else
  {
  
      $id=$this-&gt;getRequest()-&gt;getparam('id');
      if($id&gt;0)
      {
  
          $client= new Application_Model_DbTable_Client();
          $clients = $client-&gt;getClient('Id');
  
          $form-&gt;populate($clients[0]);
      }
  }
  }
  </code></pre>
  
  <p>And here is my model code.</p>
  
  <pre><code>public function updateClient($id,$firstname,$lastname,$email)
  {
      $data=array('firstname'=&gt;$firstname,
                'lastname'=&gt;$lastname,
                 'email'=&gt;$email);
   $this-&gt;update($data,"Id=$id");
  }
  </code></pre>