I am using php and postgresql.
I need a function that:
connects to a db if not already connected run the query safely put the results into an object
For example: I do a query that is 'select * from test'. I get back 2 rows...There are three columns in 'test' (id,fname,lname).
I have an object named $ep. I want to be able to put the column name results into the object and also put the values into the object. So I could do a var_dump of $ep->fname and it would show me an array with two results.
I don't want to hardcode the column names into my function. I want it to be dynamic. So regardless of what table or columns I request it will put everything into the object for me.