Hi all. I have this query:
$query = "SELECT DISTINCT sum(re.field_rows_ext_quantity) as q, re.nid, n.title from content_field_rows_ext re JOIN node n on re.nid = n.nid where lower(field_rows_ext_brand) like '%%s% group by n.title"
and this code $res = db_query($query,$marca);
But when i show the output of this query the result for q is wrong. Is correct if I exec this code:
$query = "SELECT DISTINCT sum(re.field_rows_ext_quantity) as q, re.nid, n.title from content_field_rows_ext re JOIN node n on re.nid = n.nid where lower(field_rows_ext_brand) like '%$marca% group by n.title" $res = db_query($query);
Where is my error ?
M.