$myId = 5;
$result = db_select(‘table‘, ‘t‘)
->fields(‘t‘)
->condition(‘id‘, $myId, ‘=‘)
->execute()
->fetchAssoc();
?>
the above is equivelent to:
SELECT t.* FROM table as t WHERE t.id = 7
================
http://stackoverflow.com/questions/19683409/drupal-query-builder-return-all-fields
fields('t')
时间: 2024-08-25 19:16:57