I wonder if this delete user function is correct?

0
    $data = file_get_contents("php://input");
    $objData = json_decode($data);

    $id = $objData;

    $db = new PDO("mysql:host=mysql.hostinger.com.br;dbname=u460090852_aula", "u460090852_ionic", "123456");
    if(isset($id) && $id !== " "){
        $query = $db->prepare("DELETE FROM usuarios WHERE id=".$id);
        $query->execute();
        echo "Deletado com sucesso!";
    }else{
        echo "Não foi possivel realizar a oparação!";
    }
    
asked by anonymous 18.04.2018 / 16:40

0 answers