首先,引入wp-blog-hearder.php 设置调用对象全局变量
define('PATH', dirname(dirname(__FILE__)).'/');
require_once(PATH . '../../wp-blog-header.php');
global $wpdb;
(使用相对路径对引入文件引入)
$table = "wp_application_access"; // 设置表名
$data_array = array(
'company'=> $company,
'license'=> $license,
'address'=> $address,
'concat'=> $concat,
'phonenumber'=> $phonenumber,
'email'=> $email,
'method'=> $method,
); //数组组装插入字段名对应value
$result = $wpdb->insert($table,$data_array); //wordpress内置类库直接执行函数,进行添数据库操作