Cara Delete Rows Tabel MySQL

Posted on Updated on


Untuk mendelete data yang ada di database adalah dengan cara melakukan query DELETE

Sintaks SQL:

DELETE FROM nama_tabel WHERE namafield=kondisi

Contoh :

DELETE FROM datakaryawan WHERE karyawanid=2

Pada contoh tampil di atas, jika anda jalankan akan ada link delete, yang kalau diklik akan mengarah file delete php, misal : delete.php?no=1

Sekarang mari kita buat kode PHPnya

delete.php

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s