I have 2 lines of code that deletes some data from the database:
$del_cust_recipe = $this->connection->prepare("DELETE FROM custom_ingredients_to_recipe WHERE owner_id=:owner_id AND recipe_id=:recipe_id"); $res_cust_recipe = $this->connection->executePrepared($del_cust_recipe,array('owner_id'=>$this->user_id,'recipe_id'=>$recipe_id), array('owner_id' => \Phalcon\Db\Column::TYPE_INTEGER,'recipe_id' => \Phalcon\Db\Column::TYPE_INTEGER));
It works, but I would like to know how many rows are being affected. I have tried testing for $res_cust_recipe->rowCount() or $res_cust_recipe->affectedRows() but both lead to a method not known error.
Just testing with if($res_cust_recipe) {} wouldn't cut it, as this also returns true when the affected rows are 0. Which it should: the query was succesful, so...
However I need to vary my code based on the amount of rows affected.
Are these PDO methods (rowCount and affectedRows) just not available in PhalconPHP ?
Thanks for your help, Alex