June 2002
Intermediate to advanced
800 pages
16h 3m
English
When working with object-oriented PHP, it can be helpful to retrieve data from the table as objects. Therefore PHP provides a command called pg_fetch_object, which can be used like pg_fetch_array and pg_fetch_row. To see how the command works, first create a table and insert some data:
phpbook=# CREATE TABLE plant(id int4, name text, color text); CREATE phpbook=# INSERT INTO plant VALUES (1, 'Sambucus nigra', 'yellow'); INSERT 116394 1 phpbook=# INSERT INTO plant VALUES (2, 'Abies', 'green'); INSERT 116395 1 phpbook=# INSERT INTO plant VALUES (3, 'Colchicum autumnale', 'pink'); INSERT 116396 1
If no error occurred, you have created a table containing information about three plants and their colors. ...
Read now
Unlock full access