Storing php query result into an array How can I store php query result into an array in Computed field code(PHP)?

For example:

$query = db_query('SELECT field_holiday_date_value FROM field_data_field_holiday_date');


how can I store it into an array?
$result = $query-&gt;fetchAll();


This will store the records in $result as an array. You then need to store it in the computed field, which is something like this:

$entity_field[0]['value'] = $result;


References:

https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_query/7

https://drupal.org/node/126522