<?php
$str_sql_read="select count(*) as num from userinfo";
$str_sql_del="delete from userinfo where id =
$res =link_mysql("read"
$res_del =link_mysql("delete"
echo $res_del
while($row = mysql_fetch_assoc($res))
{
echo "<font style=
}
?>
<?php
function link_mysql($opt
{
$con = mysql_connect("localhost"
mysql_set_charset("gbk"
//if you donot know how to use this function
mysql_select_db("website"
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;
}
?>
From:http://tw.wingwit.com/Article/program/PHP/201311/21156.html