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
4More
CCK - 0 views
Free Drupal e-book guides - Drupal 6 and theme setup basics, creating content, using bl... - 0 views
3More
The Great Pretender: Making your data act like a field | Lullabot - 7 views
1 - 20 of 20
Showing 20▼ items per page