Rod's should work as this should as well. I think the following could give you some flexibility.
<?
$db = "database";
$host = "localhost";
$user = "mysqluser";
$pass = "mysqlpass";
mysql_pconnect($host,$user,$pass);
$query = "SELECT COUNT(*) AS num from pc";
$result = mysql_db_query($db,$query);
$mycount = mysql_result($result,0,"num");
echo $mycount;
?>