I’m playing around with the database mysql part of Kirby.
I’m running a raw query because I want to use DELETE with IN.
$sql = "DELETE from products WHERE id IN ('" . $array_with_ids . "');";
print_r( db::query($sql) );
The result I get is not true
or false
, which is expected because the query expects a database result.
Collection Object ( [pagination:protected] => [data] => Array ( ) )
The above looks ok, because I did not use a SELECT. But how can I know if it failed? Will it return it differently?
If the query fails, I want to do something, like mail myself or store it in a page.