Answers for "get the number of affected rows in php using pdo update statement"

PHP
0

get the number of affected rows in php using pdo update statement

<?php
  $update_stmt = $db->prepare("UPDATE user SET name=:name WHERE id=:id");
$updatedCount = $update_stmt->execute(['name' => 'Bernard Arhia','id' => 2]);

//$updateCount will return true if query was successful else it will return false
Posted by: Guest on March-06-2021

Code answers related to "get the number of affected rows in php using pdo update statement"

Browse Popular Code Answers by Language