Translate
Friday, November 9, 2012
Cara membuat script delet di php
Script Hapus (delete) dalam pembuatan suatu program php, khusus nya bagi programer sangatlah penting .
contoh script nya sebagai berikut :
<?php
mysql_connect("namahost","dbuser","dbpass");
mysql_select_db("dbname");
$op = $_GET['op'];
if ($op == "delete")
{
$nim = $_GET['id'];
$query = "DELETE FROM table WHERE id = '$id'";
$hasil = mysql_query($query);
}
?>
<a href=\"".$_SERVER['PHP_SELF']."?op=delete&id=".$data['id']."\" onclick=\"return konfirmasi('".$data['nim']."')\">Hapus</a>
semoga bermanfa'at
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment