$vote is being set to the number of rows returned by the query. Your query is returning a SELECT COUNT(*), which will ALWAYS return a single row.
You have two options:
1. Change the query to SELECT * or SELECT 1 so it returns the correct number of rows, or
2. (preferred) Change your $vote assignment to read the value of COUNT(*), not the number of rows (I'm not familiar with PHP so I can't help you there)