By tomato-2 on
when I install a custom module ,the page prompted an error message:
warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /home/www/hpage/includes/database.mysqli.inc on line 323.
that's why?
Those are my install() code below:
<?php
function msg_install(){
drupal_set_msg(t('准备安装留言簿'));
$sql = "CREATE TABLE message (
nid int NOT NULL default 0,
uid int NOT NULL default 0,
rep int NOT NULL default 0,
created int NOT NULL default 0,
content varchar(225) NOT NULL,
PRIMARY KEY (nid,uid)
);";
db_query("DROP TABLE `message`".$sql);
$success = 'TRUE';
if ($success){
drupal_set_message(t('安装成功'));
}else {
drupal_set_message(t('安装失败'));
}
}
?>
Is there anything wrong?