欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

mysqli扩充

程序员文章站 2022-05-01 23:15:44
...
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

网友评论

文明上网理性发言,请遵守 新闻评论服务协议

我要评论
  • mysqli扩充
  • 专题推荐

    作者信息
    mysqli扩充

    认证0级讲师

    推荐视频教程
  • mysqli扩充javascript初级视频教程
  • mysqli扩充jquery 基础视频教程
  • 视频教程分类