如何构建这个mysqli bind_params语句然后执行它

时间:2014-03-02 10:42:44

标签: mysqli bind params

我正在编写一个函数,通过读取表结构向所有表添加记录,然后提交两个变量$params$data

$params可能是ssssssssssssss

$data将为="$Email, $First, $Surname, $Group_ID, $city, $bdFlag, $Sector, $Telephone, $createJobs, $artworker, $Password, $currentPass, $enteredBY, $Created"

如果我使用下面的声明,它可以正常工作。但是我不能用'$ data'变量替换field变量。有谁知道我怎么能做到这一点?

// This works
$stmt->bind_param($params , $Email, $First, $Surname, $Group_ID, $city, $bdFlag, $Sector, $Telephone, $createJobs, $artworker, $Password, $currentPass, $enteredBY, $Created);

// This doesn't
$stmt->bind_param($params , $data);

0 个答案:

没有答案