You are here

function dbtng_example_render_resultset_as_table in Examples for Developers 7

This function renders a resultset as table

Related topics

1 call to dbtng_example_render_resultset_as_table()
dbtng_example_grouping_list in dbtng_example/dbtng_example.module
This function groups the result set by the specified field and render a list of entries in the database

File

dbtng_example/dbtng_example.module, line 658
This is an example outlining how a module can make use of the new DBTNG database API in Drupal 7.

Code

function dbtng_example_render_resultset_as_table($result) {
  $rows = array();
  if ($result) {
    foreach ($result as $row) {

      // Sanitize the data before handing it off to the theme layer.
      $rows[] = array_map('check_plain', (array) $row);
    }
  }
  return dbtng_example_convert_resultset_to_table_render_array($rows);
}