从
mysqli::prepare文档:
在执行语句或获取行之前,必须使用mysqli_stmt_bind_param()和/或mysqli_stmt_bind_result()将参数标记绑定到应用程序变量。
bind_paramdocs。
即:
$name = 'one';$age = 1;$stmt = $mysqli->prepare("INSERT INTO users (name, age) VALUES (?,?)");// bind parameters. I'm guessing 'string' & 'integer', but read documentation.$stmt->bind_param('si', $name, $age);// *now* we can execute$stmt->execute();


