标签:失败 pass return use bsp 连接数据库 roo res sel
$host =‘localhost‘;
$root = ‘root‘;
$dbpass = ‘‘;
$db = ‘zhuce‘;
$f = mysql_connect($host,$root,$dbpass);
if(!$f){
echo ‘数据库连接失败‘;
die;
}
$f=mysql_query("use $db");
if(!$f){
echo ‘数据库选择失败‘;
}
mysql_query("set names utf8");
function my_select($sel){ //查询数据
$res = mysql_query($sel);
$result = array();
while($se=mysql_fetch_assoc($res)){
$result=$se;
}
return $result;
}
function my_insert($sql){ //插入数据
$insert=mysql_query($sql);
}
标签:失败 pass return use bsp 连接数据库 roo res sel
原文地址:http://www.cnblogs.com/phpindex/p/6107824.html