Modification de la fonctions save pour l'enregistrement des preferences avec les fonctions Zends
This commit is contained in:
parent
b1386c5498
commit
64102a3b52
@ -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('./');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user