function mycount($host,$webuser,$webpwd,$database,$table)

$dbh=mysql_connect($host,$webuser,$webpwd) or die ("服务器连接错误!");
mysql_select_db("$database") or die ("数据库连接错误!");
$sql="SELECT id FROM $table";
$result=mysql_query($sql) or die ("数据表连接错误!");
$myarray=mysql_fetch_array($result);
$id=$myarray['id'];
if($id==0)
{
$id++;
$sq="insert into {$table} (id) values ('$id')";
mysql_query($sq)or die("数据库写入错误!");
return $id;
}
else
{
$id++;
$sq="update {$table} set id='$id'";
mysql_query($sq)or die("数据库更新错误!");
return $id;
}
}给点解意见