HI All,

I am using doctrine in my project... now i am trying to update an already existing query.I am getting some DB exception..can anyone tell me what ia wrong in my code

$q = Doctrine_Query::create();  
        $campaign->update('TableName')
                  ->set('name' , $args['name'])
                  ->set ('credit' ,$args['credits'])
                 ->set('comments' ,$args['comments'])
                  ->where ('id =  2')
                  ->execute();

Why are you creating the query with $q but then using $campaign? A doctrine update should look like

Doctrine_Query::create()->update('Table')->set('field','bound_value')->where('id = ?',$bound_id)->execute()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.