I have a select query which outputs several rows. Query is working but what I need is, I want to insert a custom column with value into the above result. I am using Codeigniter 3 with PostgreSQL. The query looks like,
SELECT * FROM tbl_name ORDER BY timestamp ASC LIMIT 6;
The result I got is something like,
Array
(
[0] => Array
(
[id] => 1
[title] => Adventure Honeymoon
[nights] => 5
[price] => ₹37,000.00
[discount] => 0
)
[1] => Array
(
[id] => 2
[title] => Wild Side Of Kerala
[nights] => 4
[price] => ₹24,000.00
[discount] => 0
)
...
)
I want to add a custom column named 'category' with the result, which should looke like the below,
Array
(
[0] => Array
(
[id] => 1
[title] => Adventure Honeymoon
[nights] => 5
[price] => ₹37,000.00
[discount] => 0
[category] => Honeymoon Tours
)
[1] => Array
(
[id] => 2
[title] => Wild Side Of Kerala
[nights] => 4
[price] => ₹24,000.00
[discount] => 0
[category] => Wild Life Tours
)
...
)
Quick help will be appreciated.