I've looked at PSQL JSON Docs for a while, but I'm still a little confused about how to get it working. I have a text array in a particular row and want to pull it out into PHP and then insert into a JS var.
When I head to terminal and psql I put my query in it works great
SELECT array_to_json(COL) from TABLE where name ='foo';
However, when I create the same in a raw_execute in idiorm, I end up with a true boolean. How do I get actual results from the raw_execute into a php var? Where can I read more if this is an obnoxiously ignorant question?
Turns out raw_execute returns a bool for success or failure...
After combing idiorm docs long enough found raw_query feature here. I ended up putting my select statement from above into php var $sql and doing the following:
Because this was all being done inside a php foreach,
I was able to then insert the var into my JS dictionary
and it was then available in browser to display as desired.