954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Doctrine query

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();
rati
Junior Poster in Training
78 posts since Aug 2006
Reputation Points: 45
Solved Threads: 1
 

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()
ShawnCplus
Code Monkey
Team Colleague
1,583 posts since Apr 2005
Reputation Points: 526
Solved Threads: 268
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You