//判断数据库是否存在
public function check_database_is_exist($dbname){
$result = mysql_query('show databases;');
$data = array();//用来存在数据库名
mysql_data_seek($result,0);
while($dbdate = mysql_fetch_array($result)){
$data[] = $dbdate[ 'Database'];
}
mysql_data_seek($result,0);
if(in_array($dbname,$data)){
return true;
}else{
return false;
}
}
public function check_database_is_exist($dbname){
$result = mysql_query('show databases;');
$data = array();//用来存在数据库名
mysql_data_seek($result,0);
while($dbdate = mysql_fetch_array($result)){
$data[] = $dbdate[ 'Database'];
}
mysql_data_seek($result,0);
if(in_array($dbname,$data)){
return true;
}else{
return false;
}
}