You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my model, I'm writing a new method that calls several model methods inside a transaction.
The queries all deal with deleting data.
I am starting off with a call to the same model, deleting a row where the ID matches the input variable and a flag is set to 1
So, the first bit is easy, $this->delete($job_id) but I want to combine that with a WHERE statement, so I tried the following, based on the bit of documentation in the readme, $this->delete($job_id)->get_by('archived', 1); - this failed miserably with the following error
Fatal error: Call to a member function get_by() on a non-object
FYI, here is the code from the readme I'm referring too. I know it's about soft deletes, but I assume it should work with normal deletes?
=> $this->book_model->only_deleted()->get_by('user_id', 1);
-> SELECT * FROM books WHERE user_id = 1 AND deleted = 1
So, how do I do a delete with a where statement?
The text was updated successfully, but these errors were encountered:
In my model, I'm writing a new method that calls several model methods inside a transaction.
The queries all deal with deleting data.
I am starting off with a call to the same model, deleting a row where the ID matches the input variable and a flag is set to 1
So, the first bit is easy,
$this->delete($job_id)
but I want to combine that with aWHERE
statement, so I tried the following, based on the bit of documentation in the readme,$this->delete($job_id)->get_by('archived', 1);
- this failed miserably with the following errorFYI, here is the code from the readme I'm referring too. I know it's about soft deletes, but I assume it should work with normal deletes?
So, how do I do a delete with a where statement?
The text was updated successfully, but these errors were encountered: