Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db_host = "localhost";
- $db_name = "webdb";
- $db_user = "user";
- $db_pass = "password";
- try{
- $db_con = new PDO("mysql:host={$db_host};dbname= {$db_name}",$db_user,$db_pass);
- $db_con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- }
- catch(PDOException $e){
- echo $e->getMessage();
- }
- $id = $_REQUEST['del_id'];
- /*$_REQUEST['del_id'] is this string: "[abcd]" square brackets included*/
- $stmt=$db_con->prepare("DELETE FROM profiles WHERE context=:id");
- $stmt->execute(array(':id'=>$id));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement