I’m running a SQL query that returns two columns and X number of rows. The two columns are the value and text for a select box:
value: 1 text: Boston
value: 2 text: NYC
value: N text: Whatever
I’d like to add another row to the result set at the time the query is done so the results I get back would be something like:
value: 0 text: Select a city
value: 1 text: Boston
value: 2 text: NYC
value: N text: Whatever
I don’t want to add the new row to the DB, just to the result set. The reason I want to do this is that the query is used by a CMS and I want to avoid hacking into it. I’ve seen some solutions involving a UNION or JOIN but I would rather not store the text elsewhere.
This is my query right now:
SELECT id AS value, city AS text FROM #__cities
Is there anything like?
SELECT id AS value, city AS text FROM #__cities *APPEND id=0, formal_name='Select a city'*
You don’t need to store the text anywhere (except for the query, of course)