How do I filter my modules table (a list of articles posted with that node type); to list only nodes that have been submitted with the same content in the field?
My modules consists of posting articles using a form.
It includes having to submit what content is being submitted from a form drop down box (e.g. Horror, Action, Other). The selection is knwon as "$node->about" and "d.about".
I would like my table (which shows all nodes submitted with my moduels node type) to simply be able to filter the content by, either; horror, action, or other.
Is it possible to filter it using the SQL query:
$sql = db_rewrite_sql("SELECT n.nid, n.title, d.about FROM {deal} d INNER JOIN {node} n ON d.nid = n.nid WHERE n.status = 1");
$sql .= tablesort_sql($header);
$result = pager_query($sql, $amount);
E.g. "WHERE n.status = 1" to something like "WHERE d.about=horrow AND n.status = 1"
BUT, THIS DOES NOT WORK.
user error: Unknown column 'other' in 'where clause'
query: SELECT COUNT(*) FROM deal d INNER JOIN node n ON d.nid = n.nid WHERE d.about=other AND n.status = 1 in /LOCALHOST/includes/database.mysql.inc on line 66.
user error: Unknown column 'Other' in 'where clause'
query: SELECT DISTINCT(n.nid), n.title, d.about FROM deal d INNER JOIN node n ON d.nid = n.nid WHERE d.about=other AND n.status = 1 ORDER BY d."something" ASC LIMIT 0, 20 in /LOCALHOST/includes/database.mysql.inc on line 66.