mysqli扩展
$conn = new mysqli('localhost','root','123','zx','3306');
if (mysqli_connect_errno()) {
printf(connect failed: %s\n, mysqli_connect_error());
exit();
}
$prepare = $conn -> prepare(insert into test (uid,name) values('?','?'));
$num = 12;
$hanzi = xiha;
$prepare -> bind_param('is',$num,$hanzi);
$prepare -> execute();
test表字段,uid int(11) name varchar(30)
warning: mysqli_stmt::bind_param() [function.mysqli-stmt-bind-param]: number of variables doesn't match number of parameters in prepared statement in
分享到:
------解决方案--------------------
已经解决了