<?php
¥str_sql_read=" count() as num userinfo";
¥str_sql_del=" userinfo where id =1";
¥res =link_mysql("read",¥str_sql_read);
¥res_del =link_mysql("",¥str_sql_del);
echo ¥res_del."<br/>";
while(¥row = mysql_fetch_assoc(¥res))
{
echo "<font style=font-size:25px;color:red;>".¥row[num]."</font><br/>";
}
?>
<?php
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__db("website",¥con);
switch(¥opt){
case "read":
¥res =mysql_query(¥str_sql);
break;
case "":
case "":
case "":
¥res =mysql_query(¥str_sql);
break;
}
mysql_close();
return ¥res;
}
?>