In the Drupal 6 database, for every content type, there is a table that’s called content_type_[your_field_name] Now I have a database query as follows in drupal 6 :
db_query("SELECT n.nid FROM {node} n INNER JOIN {content_type_field_abc} s ON n.vid = s.vid INNER JOIN {def_table} sts ON s.nid = sts.nid WHERE n.type = 'trans' AND s.field_study = '%s' AND sts.status = 1", $account->name);
Then how can I use db_query in drupal 7 to get a table containing all the fields of the content type as columns same as drupal 6 ?
Or
Simply, how can I write the above given query in drupal 7 ?