ask about DAO update

hi, i am stucked using DAO to update my record. no row affected… and i follow the instruction from

please help me to see if anything wrong in my code?






and here is the query show in firebug… it is not a query… but parameterized

UPDATE reference SET reference_status_id=:reference_status_id WHERE id=:id. Bound with :id=‘66’, :reference_status_id=‘0’

but after i check the db… no row affected…

i have no idea how to debug. please assist~

I haven’t done a lot of work with DAO but it looks ok to me. Check to see if your table is using ‘0’ as default. I.e. the value is already ‘0’ before the update. Change the value to 1 and try again.


thanks for reply Matt~

I tried using Active Record updateByPk is working to me,

and I try to optimize, so I try to update with DAO. same logic but not working

I tried to make the DAO sql output from firebug as same as the AR sql.

but the table still not updated~


You need to assign the value in the parameter list…







I tried this too. that was my initial tried code :)