Modification de la fonctions save pour l'enregistrement des preferences avec les fonctions Zends

This commit is contained in:
Damien LASSERRE 2012-01-11 10:48:12 +00:00
parent b1386c5498
commit 64102a3b52

View File

@ -50,15 +50,15 @@ class IndexController extends Zend_Controller_Action
'login' => $user->username,
'json' => $this->fields->getNotActivated($fields),
);
$sql = $prefsModel->select()->where('login = ?', $user->username);
$rows = $prefsModel->fetchAll($sql);
if (count($rows)>0) {
$prefsModel->update($data, 'login = '.$user->unsername);
$prefsModel->select()->where('login = "?"', $user->username);
$rows =$prefsModel->fetchRow();
$rows = $rows->toArray();
if (count($rows) > 0) {
$prefsModel->update($data, 'login = "'.$user->unsername.'"');
} else {
$prefsModel->insert($data);
}
$this->_redirect('./');
}