Wednesday, June 11, 2008

PHP-script delete

<?
$conn = mysql_connect("localhost","root","");
$db = mysql_select_db("basdat",$conn);
$id_pesanan = $HTTP_GET_VARS['id_pesanan'];
$tmp_id_kamar = $HTTP_GET_VARS['id_kamar'];
$tmp_id_meeting = $HTTP_GET_VARS['id_meeting'];
$sql = "delete from pesanan where id_pesanan='$id_pesanan'";
$que = mysql_query($sql);
if ($tmp_id_kamar!="")
{
$sql2 = mysql_query("update kamar set status = 'kosong' where id_kamar = '$tmp_id_kamar'");
}
if ($tmp_id_meeting!="")
{
$sql3 = mysql_query("update meeting set status = 'kosong' where id_meeting = '$tmp_id_meeting'");
}
header("location:viewpesanan.php");
mysql_close($conn);
?>

No comments:

Post a Comment