wpdb::delete

Delete a row.

function hapus_siswa( $id ) {
    global $wpdb; 

    return $wpdb->delete(
        $wpdb->prefix . 'id_siswa', // table name with dynamic prefix
        ['id' => $id], // which id need to delete
        ['%d'], // make sure the id format
    );
} 

Last updated