Hey I am trying to prevent sql injections using PDO
is this a good practise?
is this a good practise?
PHP:
function esape2($string) {
return htmlentities($string, ENT_QUOTES, 'UTF-8');
}
$getid = htmlentities($_GET['id']);
$id = esape2($getid);
$findpro = $forum->prepare("SELECT * FROM `store` WHERE `itemid`=:id");
$findpro->bindParam(':id', $id);
$findpro->execute();
$exists = $findpro->rowCount();
