I am transitioning from 'old school' php mysql methods of using mysql_fetch_array, etc., And I am trying to be more Drupally by using the Database API in my modules.
I simply want to return and print out a value. for example
$query = db_query("select zip from {zipcodes} where city = :city limit 1", array(":city" => $city));
I know the value is there, I can access and print it by using traditional methods outside the database api
print $query->zip is not working. The API documentation is as clear as mud. Can someone tell me the correct way to access these values? Is there a good tutorial anyone could recommend as well? Thanks!