display query results

Поиск
Список
Период
Сортировка
От PJ
Тема display query results
Дата
Msg-id 48909454.7040305@videotron.ca
обсуждение исходный текст
Ответы Re: display query results  ("Matthias Ritzkowski" <matthiar@gmail.com>)
Re: display query results  (Robert Treat <xzilla@users.sourceforge.net>)
Список pgsql-php
I am trying to learn postgresql with psql - using FreeBS D7.0,
postgresql 8.3.3 php 5.2.6, apache 2.2.9

How can I echo or print on screen the results; all I get from this code
is this:
Resource id #3
item_idglossary_idnamedescription
which is the field names run together

I am expecting to see several long text sentences.

Here is the snippet and the connection does work and the database is
there and functioning.

        $db = pg_connect("host=localhost port=5432 dbname=med user=med
password=0tscc71");

        if (!$db)
        {
        die("Could not open connection to database server");
        }

         // generate and execute a query
        $query = "SELECT description FROM glossary_item WHERE
name='Alcohol'";
        $result = pg_query($db, $query) or die("Error in query: $query.
        " . pg_last_error($db));

        // Print result on screen
        echo "$result";

        pg_close($db);

What am I doing wrong?


В списке pgsql-php по дате отправления:

Предыдущее
От: Andrew McMillan
Дата:
Сообщение: Re: newbie issues with PDO / stored procedures
Следующее
От: "Matthias Ritzkowski"
Дата:
Сообщение: Re: display query results