Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

ThinkPHP 3.2.3 使用bind add增加数据出现的问题 #505

Open
jinger7281 opened this issue Aug 23, 2017 · 0 comments
Open

ThinkPHP 3.2.3 使用bind add增加数据出现的问题 #505

jinger7281 opened this issue Aug 23, 2017 · 0 comments

Comments

@jinger7281
Copy link

代码(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]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant