Update save() error #15589
-
I have trouble saving update with this error. Please help! Thanks! Fatal error: Uncaught Error: Call to undefined method Phalcon\Mvc\Model\Resultset\Simple::save() Here is my code: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
$updateOerl = Oerl::findFirst([
"StudID = :stuid: AND SysNum = :sysnumber:',
'bind' => [
'stuid' => $resultStud->StudID,
'sysnumber' => $result->SysOsbj
]
]); |
Beta Was this translation helpful? Give feedback.
find()
returns a result set, not a single record. What you want to use isfindFirst()
. You also want to use prepared queries to eliminate the possibility of code injection into your queries. So modify your code like so: