// 版本信息
const THINK_VERSION = '3.2.2';
indexController.class.php代码如下
$user_flag = D("Userflag");
$d['from_user'] = $data['FromUserName'];
$d['flag_id'] = 1;
$user_flag->add($d);
UserflagModel.class.php 代码如下:
namespace Home\Model;
use Think\Model;
class UserflagModel extends Model
{
protected $autoCheckFields = false;
}
数据库连接
/* 数据库设置 */
'DB_TYPE' => 'mysql', // 数据库类型
'DB_HOST' => 'localhost', //服务器地址
'DB_NAME' => 'weixin', //数据库名
'DB_USER' => 'root', //用户名
'DB_PWD' => '*********', //密码
'DB_PORT' => '3306', //端口
'DB_PREFIX' => 'wx_', //数据库表前缀
'DB_CHARSET' => 'utf8', //数据库编码默认采用utf8
数据库表名为:userflag
提示错误信息为;1146;table 'weixin.wx_userflag' doesn't exist
最佳答案