请问这段代码正确吗,我调试了一天了,数据库里还是没有写入
@mysql_query("create database`".db_name."`");@mysql_query("set names gbk");
@mysql_select_db(db_name,$link);
$sql[]="drop table if exists `admin`";
$sql[]="drop table if exists `img`";
$sql[]="drop table if exists `lssite`";
$sql[]="drop table if exists `ssite`";
$sql[]="CREATE TABLE `admin` (
`name` varchar(20) default NULL ,
`pass` varchar(20) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=gbk;";
$sql[]="CREATE TABLE `img` (
`dat` varchar(20) default null,
`location` varchar(150) default null,
PRIMARY KEY (`dat`)
)ENGINE=MyISAM DEFAULT CHARSET=gbk;";
$sql[]="CREATE TABLE `lsite` (
`lisite` varchar(300) default null,
`nasite` varchar(300) default null,
fav varchar(8) default NULL,
PRIMARY KEY (`lisite`)
)ENGINE=MyISAM DEFAULT CHARSET=gbk;";
$sql[]="CREATE TABLE `ssite` (
`sesite` varchar(300) default null,
`nmsite` varchar(300) default null,
PRIMARY KEY (`sesite`)
)ENGINE=MyISAM DEFAULT CHARSET=gbk;";
foreach($sql as $val){
@mysql_query($val,$link);