-
Notifications
You must be signed in to change notification settings - Fork 220
Open
Description
oscommerce2/catalog/includes/OSC/OM/Db.php
Line 300 in de0e97d
| return $Q->rowCount(); |
rowCount() is not working anyways in updates and delete. DB::Save when update used not pass driver options so would be better to use DB::prepare instead.
PHP doc refered this issue: https://www.php.net/manual/en/pdostatement.rowcount.php#104930
I suggest to use directly driver_options for prepare functions only:
if (!isset($driver_options[\PDO::MYSQL_ATTR_FOUND_ROWS]) || $driver_options[\PDO::MYSQL_ATTR_FOUND_ROWS] === FALSE) {
$driver_options[\PDO::MYSQL_ATTR_FOUND_ROWS] = TRUE;
}or prepare directly
$Qsave = $this->app->db->prepare('update :table_orders set billing_country = :country_name where orders_id = :orders_id', [
'\PDO::MYSQL_ATTR_FOUND_ROWS' => TRUE
]);
$Qsave->bind...
...
$Qsave->execute();
$affected = $Qsave->rowCount();DB::save and DB::delete are not safety in all enviroments and the documentations is false.
Metadata
Metadata
Assignees
Labels
No labels