thinkphp
thinkphp copied to clipboard
ThinkPHP 3.2.3 使用bind add增加数据出现的问题
代码(Code):
$model = M('User');
$model->user_name = ':username' //注意此处user_name与后面的username是不对应的(Caution: the former user_name is not username )
$model->input_time = ':inputtime' //同上(like upper)
$bind = array(
':username' => array($username, \PDO::PARAM_STR),
':inputtime' => array($time, \PDO::PARAM_STR)
);
$model->bind($bind)->add();
此代码会产生怪异的行为,bind自动生成一个:x(x为int,如8)的key,导致参数不对应(This code will produce a weird action, bind will automatically genertate a key like ':x'[x is an integer like 8 or others]