Find if Update happened or not in PDO Php -


i using following code update query. suppose ability value 0 , update didn't happen. how can find out?

$statement = $conn->prepare ('update players set                     ability = ability - 1 id = :playerid , ability > 0');  $statement->bindparam (':playerid', $player['id'],pdo::param_int);  $statement->execute(); 

$stmt = $conn->prepare("update....."); $stmt->execute(array($var, $var)); 

now, if want check success update..

if($stmt->rowcount() > 0){     //means updated }else{    //means not updated } 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -