Trouble using sql count

I’m trying to count how many posts there are from each state in a table in my db ideally it would put the number in an array 0-49 alphabetically in order of states, but i can’t seem to get it to work this is the code so far.

$q = “SELECT CompanyState, count(*) AS Number FROM job_post GROUP BY CompanyState ORDER BY CompanyState”;
$result = mysql_query($q);
$result2 = mysql_fetch_array($result);

when i echo out the array it only shows the first post count which is Alabama but i can’t get any others. is there a way to only select the counts in order? I then want to output it to a flash movie, but i think I can do that if i can get this to work. Thanks for your help!