自定义删除记录代码

时间:2016-10-24 06:32:46

标签: wordpress

我想使用wpdb删除记录自定义,但它不起作用...帮帮我

<?php
              global $wpdb;
                $id = $_GET['id'];
                $tablename = $wpdb->prefix . 'salary';
                $mylink = $wpdb->get_row( "SELECT * FROM $tablename WHERE id = $id", ARRAY_N );if ( isset( $_GET['delete'] ) ) {    
$wpdb->delete( $tablename, array( 'id' => $id ), array( '%d' ) );echo 'Record successfully deleted';}else{
echo 'There are some problem ,you  can not  delete';}?>

0 个答案:

没有答案