I think you're doing what mysql already did.
Do
Query variables:
Echo "Pound $pound: & pussy: $a_cat<br>";
$query = "SELECT pound FROM rspca WHERE a_cat=$a_cat";
// ERROR HERE, YOU HAVE db before SQL string, its backwards, do the following >>>>
$category = mysql_query($query,$db) or die("UPS, ERROR HERE UNABLE TO RUN SQL<br>SQL = ".$query);
//check whether cat lives in another pound ?!
while ($row = mysql_fetch_array($category)){
// This past line is ok
// not valid :>> while ($row){ ß----------- IS THIS VALID?!
echo "Also exist in ".$row["pound"];
}
You also have the following problem:
$match = $row['a_cat'];
There is no a_cat column in the result because you said
SELECT pound FROM...
Saludos
Gerardo