logo
Blog single photo

update and delete in pdo


                        

<?php
$sql="update dr_attached set att_name=:att_name,
        att_path=:att_path,
        att_cat=:att_cat,
        att_url=:att_url,
        active=:active where id=:id";
$qry=$db->prepare($sql);
$success = $qry->execute(array(   
                ':att_name'=>$image_name,
                ':att_path'=>$full_path_back,
                ':att_cat'=>$image_type,
                ':att_url'=>$actual_link,
                ':active'=>$act,
                ':id'=>$val_h_id
               ));
?>   
          
and Delete...   

<?php
$val_h_id=$_POST['h_id'];
$sql="delete from dr_attached where id=:id";
$data=$db->prepare($sql);
$data->execute(array(':id'=>$val_h_id));
?>

Top