php delete in witdh explode update
Get the solution ↓↓↓when I delete the category from the reference category, it completely erases the reference post in the reference table.
I want is if the category is deleted, the "reference_categories" in the reference table; If the number is 1, delete it, if not, update it and delete the id there.
DELETE
$table = get('table');
$column = get('column');
$id = get('id');
$query = $db->delete($table)
->where($column, $id)
->done();
if ($table == 'reference_categories') {
if ($query) {
$reference = $db->from('reference')
->where('reference_categories', $id)
->first();
$db->delete('reference')
->where('reference_categories', $id)
->done();
}
}
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: you must enable the openssl extension in your php.ini to load information from https://repo.packagist.org
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.