try:
$count = mysql_numrows($data);
it says you're passing the mysql_numrows an array when it expects a resource.