Is there a function which would return true of false based on if the DELETE SQL statement succeded or not? For example something like this:
<?php
$sql = "DELETE FROM table WHERE id=123";
$result = pg_query($sql);
if **function**($result)
return true;
else
return false;
?>
Further more, is there maybe a function which returns the number of successfully deleted rows?
Use mysql_affected_rows() to get number of affected rows in mysql.
Similary for postgres, it will be pg_affected_rows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With