Always use content_database_info to get the database info. For example:
$field1 = content_database_info(content_fields('yourfield1', 'yourtable')); $table1 = $field1['table']; $column1 = $field1['columns']['value']['column']; $field2 = content_database_info(content_fields('yourfield2', 'yourtable')); $table2 = $field2['table']; $column2 = $field2['columns']['value']['column']; if ($table1 == $table2) { $sql = "SELECT n.*, t1.$column1, t1.$column2 FROM {node} n "; $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid"; } else { $sql = "SELECT n.*, t1.$column1, t2.$column2 FROM {node} n "; $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid"; $sql .= " INNER JOIN {$table2} t2 ON t2.nid = n.nid AND t2.vid = n.vid"; } $sql .= " WHERE n.nid = %d";
Group items matching
in title, tags, annotations or url
1More
The State of Drupal | DrupalCon DC - 0 views
Building a "Blog Feature" in Drupal with Context and Spaces | Development Seed - 0 views
Theming Views 2 - The Basics | Group 42 - 0 views
1More
Lullabot-TheBuzzrDemoDrupalUsabilityByLullabot931.mov (video/quicktime Object) - 0 views
1More
Web Development Company - The Need of The Hour - 0 views
« First
‹ Previous
481 - 494 of 494
Showing 20▼ items per page