I am trying to perform the below simple query:
$query = db_select('sage.USER', 'USER') ->fields('USER', array('USER_ID', 'OFFICE_ID')); $result = $query->execute();
I would like to then pull out the 'office_id' that is returned by the query, which I have been told can be done with the following:
$office = $result->office_id;
However, when I do 'print_r($office)' or 'echo $office', it would seem the $office string is empty. The database is not empty and contains the appropriate values.
Could someone please how I can pull out the contents of a drupal 7 query?