Welcome Guest, Not a member yet? Register   Sign In
fetching data - PostgreSQL array of composite types and CI
#1

[eluser]Unknown[/eluser]
Hi, I have question related to PostgreSQL and CI. I have a table

Code:
CREATE TABLE mytable (
    id      integer CONSTRAINT firstkey PRIMARY KEY,
    somedata my_type[]
);

where my_type is defined as a composite type as follows:

Code:
CREATE TYPE AS my_type{
nmbr integer,
sometext text
}

I would like to somehow fetch array somedata from mytable and then store each element of that array (object of type my_type) into php array with key nmbr and value sometext, e.g
a['$nmbr']=$sometext.

Is something like this possible with CI and PostgreSQL and how to do it? Is there maybe a better php structure on which I could map composit type (my_type) elements of an array somedata ?

I am very new to CI, so please advise.

Any kind of help would be very appreciated!
Thanks in advance Smile

Regards,
mare




Theme © iAndrew 2016 - Forum software by © MyBB