Model->save() returns true or false.
You can then use Model->errors to see the reasons why.
can you also get the number of affected rows ?
TableModel::rowCount()
or TableModel->rowCount() ?
??? .
that's obviously not the right thing
Let me explain: I have a user management page for the administrators in my web-application.
If an administrator only changes the user-rights, there's no change in the actual users table. But as a single function processes the user-management form, it does write the form-contents to the user-table.
Before I used mysqli and evaluated the return value of "affected Rows" to check if the update to the users table actually changed the user entry or not (affected Rows would be zero if nothing changed).
To "replicate" the behaviour of the function with PHP AR , I use
update_attributes(array)
And now I want to check again if the call to that method actually changed the user entry or not (to give appropriate response to the administrator ("No Changes to the User-Entry, the old password is still valid") <->("A new password has been activated, changes were successfully saved")
(1-4/4)
Subject: How to check the status of query execution
Hi ,
I am trying to do an insert.
Say
TableModel->save();
i want to know if insertion was success or did it throw any error (can be any reason say column doesn't exist or malformed url)
Does the TableModel->save(); return any value which i can capture to check the status of query execution ?