I want to create a method for my class that deleting one record, here is the source:
/* Delete One Record
* in @param (string) $tbl - name of the table
* in @param (int) $idn - id of record
* @return (int) - identifier of removed record
*/
public function DelOne($tbl,(int)$idn)
{
if ($result = $this->pdo->prepare("DELETE FROM `".$tbl."` WHERE `id`=:idn"))
{
$result->bindValue(":idn",$idn,PDO::PARAM_INT);
$result->execute();
}
}
And I want that this function returns me an identifier of just removed record instead of standart TRUE/FALSE combination.
Add
return $idnin the function?