Skip to content

Update save() error #15589

Answered by quasipickle
mis-uep asked this question in Q&A
Jul 13, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

find() returns a result set, not a single record. What you want to use is findFirst(). You also want to use prepared queries to eliminate the possibility of code injection into your queries. So modify your code like so:

$updateOerl = Oerl::findFirst([
    "StudID = :stuid: AND SysNum = :sysnumber:', 
    'bind' => [
        'stuid'     => $resultStud->StudID,
        'sysnumber' => $result->SysOsbj
    ]
]);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mis-uep
Comment options

Answer selected by mis-uep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants