mysqli扩充

原创
2016-06-13 11:39:58 544浏览

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
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。