I have a form with the following fields:
- password
- url
- responsable
- pais (this is a multicheckbox)
- role
And I've created this method within the Model_Users class
public function updateUser($user) {
$q = Doctrine_Query::create()
->update('Model_Users usr'); //aca estaba el ;
foreach ($user as $k => $v) {
if ($k == 'pais' || $k == 'id') {
continue;
} else {
$q->set("usr.$k", '?', $v);
//echo "Key: $k => Value: $v ||";
}
}
$q->where("usr.id=$user[id]");
$q->execute();
}
The problem is that this isn't really updating... and if I do something like echoing $q->getSqlQuery()
the SQL query I get is UPDATE users SET email = ?, password = ?, url = ?, responsable = ?, role = ? WHERE (id = 150)
.
I'm guessing I cannot use a foreach loop to get this right,... so what would be the way around it?