0

when i take one array it`s working fine but when i take

Catchable Fatal Error: Argument 3 passed to Doctrine\DBAL\Connection::update() must be of the type array, none given, called in D:\wamp\www\JPL\src\Jotun\TeamManagmentBundle\Controller\DefaultController.php on line 180 and defined in D:\wamp\www\JPL\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php line 497

Here is my Controller

  public function updateAction()
 {



    $request = $this->getRequest();
    $company_name = $request->get('company_name');
    $team_name = $request->get('teamname');
    $mobileno = $request->get('mobileno');
    $email = $request->get('email');
    $em = $this->getDoctrine()->getManager();
    $conn = $this->get('database_connection');

    $conn->update('teams',array( 'company_name'=>$company_name,'team_name'=>$team_name,'mobile_no'=>$mobileno,'email_id'=>$email));

    return $this->redirect($this->generateUrl('jotun_teams'));   
 }  

i am not getting it.Thanks In advance

4

1 回答 1

1

需要 DBAL 更新方法的第三个元素。它必须在关联数组(字段值)中包含更新条件。例如:

$conn->update(
    'teams',
     array(     
         'company_name'=> 'NewCompanyName'
         ),
     array(
         'company_name' => 'CurrentCompanyName'
         )
  );
于 2014-08-28T19:36:00.777 回答