I have two queries that I am combining using a UNION statement. I know that I need both queries to get the same number and type of arguments to work.
I have one query that only really needs three fields and one that needs four.
Eg query 1's select line looks like this
query 2's select line looks like this, XX denotes where I need to insert a dummy field:
->select ($db->quoteName(array('b.event','a.date','a.type', XX)))
What the syntax for putting a dummy field into the select statement of the second query please?
I haven't tested it (short on time), but I think this should add a dummy column b.mob which is filled with string 'dummy'.
->select ($db->quoteName(array('b.event','a.date','a.type'))) ->select ($db->quote('dummy'). ' AS ' . $db->quoteName('b.mob'))
The equivalent sql should be
SELECT `b.event`, `a.date`, `a.type`, 'dummy' AS `b.mob`