php,mysql准备好的语句
function addAlbum($album){
$connection = mysqli_connect(HOST,USER,PASS,DATABASE);
$stmt = mysqli_prepare($connection,'INSERT INTO `'.TABLE_ALBUMS.'` (albumName) VALUES (":album")');
mysqli_stmt_bind_param($stmt,':album');
$result = mysqli_stmt_execute($stmt);
if($result){
return true;
} else {
return false;
}
}
我收到此错误:
mysqli_stmt_bind_param() [function.mysqli-stmt-bind-param]: Number of elements in type definition string doesn't match number of bind variables
任何帮助将不胜感激。
function addAlbum($album){
$connection = mysqli_connect(HOST,USER,PASS,DATABASE);
$stmt = mysqli_prepare($connection,'INSERT INTO `'.TABLE_ALBUMS.'` (albumName) VALUES (":album")');
mysqli_stmt_bind_param($stmt,':album');
$result = mysqli_stmt_execute($stmt);
if($result){
return true;
} else {
return false;
}
}
i get this error:
mysqli_stmt_bind_param() [function.mysqli-stmt-bind-param]: Number of elements in type definition string doesn't match number of bind variables
any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您混合了过程风格和面向对象风格
因此,要么完全使用过程风格,要么反之亦然
You have mix both procedural style and Object oriented style
So, either use entirely in procedural style or vice versus