时间:2021-07-01 10:21:17 帮助过:22人阅读
?>
function link_mysql($opt,$str_sql)
{
$con = mysql_connect("localhost","root","root") or die ('Not connected : ' . mysql_error());
mysql_set_charset("gbk",$con);
//if you donot know how to use this function,find it defination;
mysql_select_db("website",$con);
switch($opt){
case "read":
$res =mysql_query($str_sql);
break;
case "update":
case "delete":
case "insert":
$res =mysql_query($str_sql);
break;
}
mysql_close();
return $res;
}
?>