census_country($key)
census/census.module, line 58
Call based on country id
function census_country($key) {
// grab the data from the external db
db_set_active('external');
$data = db_fetch_object(db_query("SELECT * FROM {country} WHERE cid = %d", $key));
// switch back to Drupal before doing anything else!
db_set_active('default');
drupal_set_title($data->country);
$header = array();
$temp = $data;
unset($temp->cid);
foreach ($temp as $key => $value) {
$title = census_key($key);
$rows[] = array($title, $value);
}
return theme('table', $header, $rows);
}