More specifically:
mysql_query returns a resource, not an array.
A resource is an abstraction that you can regard as an imaginary bucket of results that could contain any number of records, including zero.
In EVERY case, even if there is only one row returned, you must use a "fetch" function, such as mysq_fetch_array, mysql_fetch_object, etc., in order to get at the underlying data.
See the appropriate manual pages for code examples.