Sunday, December 12, 2010

Standardized Query to select all records from a table in Drupal 7


$users = db_select('users')
->fields('users')
->execute()
->fetchAll();

foreach($users as $key=>$value){
echo $value->uid.",";
}

?>
outputs like : 0,1,..

1 comment: