first steps in PhP and PostgreSQL

Lists: pgsql-general
From: Desmond Coughlan <coughlandesmond(at)yahoo(dot)fr>
To: pgsql mailing list <pgsql-general(at)postgresql(dot)org>
Subject: first steps in PhP and PostgreSQL
Date: 2006-11-06 14:05:25
Message-ID: 20061106140525.59034.qmail@web23110.mail.ird.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

X-No-Archive: true

Hi,
I'm sure that it's a typo or something, but as I'm getting into PhP and PostgreSQL for the first time, I can't be sure.

I have a db, called 'cdi' ..

A 'SELECT * FROM stock;' gets me this in psql ..

cdi=> SELECT * from stock ;
-[ RECORD 1 ]-+-------------------------------
stock_ids | 1
isbn_no | 10101010
code_livre | 23455
titre | toto goes to Hollywood
editeur | editions toto
collection | collection toto
auteur_nom | smith
auteur_prenom | john
matiere | ang
media_type | li
-[ RECORD 2 ]-+-------------------------------
stock_ids | 2
isbn_no | 10536278
code_livre | 24874
titre | toto comes back from Hollywood
editeur | editions baba
collection | collection toto
auteur_nom | martin
auteur_prenom | peter
matiere | fre
media_type | dvd

So the db is populated. I now do this in a file called base.php ..

<?php
pg_connect ("dbname=cdi user=cdi password=toto") or die
("Couldn't Connect: ".pg_last_error());
$query="SELECT * FROM stock";
$query=pg_query($query);
// start the output
while($row=pg_fetch_array($query,NULL,PGSQL_ASSOC)) {
echo "Title: ".$row['isbn_no']."<br />";
echo "blah ".$row['code_livre']."<br />";
}
?>



I copy that file to my apache server, in php_experimental/base.php and access it via a browser.

I don't get an error message. I instead get a blank page.

Your advice would be welcome.

D.


---------------------------------
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.


From: Bill Moran <wmoran(at)collaborativefusion(dot)com>
To: Desmond Coughlan <coughlandesmond(at)yahoo(dot)fr>
Cc: pgsql mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: first steps in PhP and PostgreSQL
Date: 2006-11-06 14:13:33
Message-ID: 20061106091333.30ed12fc.wmoran@collaborativefusion.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

In response to Desmond Coughlan <coughlandesmond(at)yahoo(dot)fr>:

> X-No-Archive: true

X-WTF: huh?

[snip]

> I copy that file to my apache server, in php_experimental/base.php
> and access it via a browser.
>
> I don't get an error message. I instead get a blank page.

Check the applicable php.ini for where error messages are being sent to.
It's typical on production servers to configure PHP to only send errors
to syslog, or a file, which usually means they end up in httpd-error.log.

When developing, it's usually more convenient to have errors sent to the
browser, which is what it seems you were expecting.

--
Bill Moran
Collaborative Fusion Inc.


From: Richard Huxton <dev(at)archonet(dot)com>
To: Desmond Coughlan <coughlandesmond(at)yahoo(dot)fr>
Cc: pgsql mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: first steps in PhP and PostgreSQL
Date: 2006-11-06 14:42:15
Message-ID: 454F49C7.9010203@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Desmond Coughlan wrote:
> <?php
> pg_connect ("dbname=cdi user=cdi password=toto") or die
> ("Couldn't Connect: ".pg_last_error());
> $query="SELECT * FROM stock";
> $query=pg_query($query);

Firstly, rewrite this as
$sql = "SELECT * FROM stock";
$res = pg_query($sql);

echo "pg_query($sql) = $res<br>";
echo "num rows = ".pg_num_rows($res)."<br>";

> // start the output
> while($row=pg_fetch_array($query,NULL,PGSQL_ASSOC)) {
> echo "Title: ".$row['isbn_no']."<br />";
> echo "blah ".$row['code_livre']."<br />";
> }
> ?>

Now you'll know what the return-code of pg_query was as well as how manu
rows it returned. Does that help at all?

--
Richard Huxton
Archonet Ltd


From: Roman Neuhauser <neuhauser(at)sigpipe(dot)cz>
To: Desmond Coughlan <coughlandesmond(at)yahoo(dot)fr>
Cc: pgsql mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: first steps in PhP and PostgreSQL
Date: 2006-11-06 16:18:48
Message-ID: 20061106161848.GE95663@dagan.sigpipe.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

# coughlandesmond(at)yahoo(dot)fr / 2006-11-06 15:05:25 +0100:
> I'm sure that it's a typo or something, but as I'm getting into PhP
> and PostgreSQL for the first time, I can't be sure.

> <?php
> pg_connect ("dbname=cdi user=cdi password=toto") or die
> ("Couldn't Connect: ".pg_last_error());
> $query="SELECT * FROM stock";
> $query=pg_query($query);
> // start the output
> while($row=pg_fetch_array($query,NULL,PGSQL_ASSOC)) {
> echo "Title: ".$row['isbn_no']."<br />";
> echo "blah ".$row['code_livre']."<br />";
> }
> ?>
>
> I copy that file to my apache server, in php_experimental/base.php
> and access it via a browser.
>
> I don't get an error message. I instead get a blank page.

Check apache's error log. If you can't figure it out then, better
place to ask further questions would be php-general(at)lists(dot)php(dot)net(dot)

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991


From: Ben <bench(at)silentmedia(dot)com>
To: Desmond Coughlan <coughlandesmond(at)yahoo(dot)fr>
Cc: pgsql mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: first steps in PhP and PostgreSQL
Date: 2006-11-06 17:28:15
Message-ID: Pine.LNX.4.64.0611060928060.8155@GRD.cube42.tai.silentmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Have you checked your webserver error logs?

On Mon, 6 Nov 2006, Desmond Coughlan wrote:

> X-No-Archive: true
>
> Hi,
> I'm sure that it's a typo or something, but as I'm getting into PhP and PostgreSQL for the first time, I can't be sure.
>
> I have a db, called 'cdi' ..
>
> A 'SELECT * FROM stock;' gets me this in psql ..
>
> cdi=> SELECT * from stock ;
> -[ RECORD 1 ]-+-------------------------------
> stock_ids | 1
> isbn_no | 10101010
> code_livre | 23455
> titre | toto goes to Hollywood
> editeur | editions toto
> collection | collection toto
> auteur_nom | smith
> auteur_prenom | john
> matiere | ang
> media_type | li
> -[ RECORD 2 ]-+-------------------------------
> stock_ids | 2
> isbn_no | 10536278
> code_livre | 24874
> titre | toto comes back from Hollywood
> editeur | editions baba
> collection | collection toto
> auteur_nom | martin
> auteur_prenom | peter
> matiere | fre
> media_type | dvd
>
> So the db is populated. I now do this in a file called base.php ..
>
> <?php
> pg_connect ("dbname=cdi user=cdi password=toto") or die
> ("Couldn't Connect: ".pg_last_error());
> $query="SELECT * FROM stock";
> $query=pg_query($query);
> // start the output
> while($row=pg_fetch_array($query,NULL,PGSQL_ASSOC)) {
> echo "Title: ".$row['isbn_no']."<br />";
> echo "blah ".$row['code_livre']."<br />";
> }
> ?>
>
>
>
> I copy that file to my apache server, in php_experimental/base.php and access it via a browser.
>
> I don't get an error message. I instead get a blank page.
>
> Your advice would be welcome.
>
> D.
>
>
> ---------------------------------
> Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.
>From pgsql-general-owner(at)postgresql(dot)org Mon Nov 6 13:20:33 2006
Received: from localhost (wm.hub.org [200.46.204.128])
by postgresql.org (Postfix) with ESMTP id B2E4F9FA136
for <pgsql-general-postgresql(dot)org(at)postgresql(dot)org>; Mon, 6 Nov 2006 13:20:32 -0400 (AST)
Received: from postgresql.org ([200.46.204.71])
by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024)
with ESMTP id 14382-01 for <pgsql-general-postgresql(dot)org(at)postgresql(dot)org>;
Mon, 6 Nov 2006 17:20:26 +0000 (UTC)
X-Greylist: from auto-whitelisted by SQLgrey-
Received: from mx01.bfk.de (mx01.bfk.de [193.227.124.2])
by postgresql.org (Postfix) with ESMTP id BD69C9F9806
for <pgsql-general(at)postgresql(dot)org>; Mon, 6 Nov 2006 13:20:19 -0400 (AST)
Received: from [10.119.110.2] (helo=mx00.int.bfk.de)
by mx01.bfk.de with esmtp id 1Gh88r-0002mS-A6; Mon, 06 Nov 2006 18:20:13 +0100
Received: from fweimer by bfk.de with local id 1Gh88r-00027m-60; Mon, 06 Nov 2006 18:20:13 +0100
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: DISTINCT is not quite distinct
References: <82lkmoy979(dot)fsf(at)mid(dot)bfk(dot)de> <454F47F7(dot)6090108(at)archonet(dot)com>
From: Florian Weimer <fweimer(at)bfk(dot)de>
Date: Mon, 06 Nov 2006 18:20:13 +0100
In-Reply-To: <454F47F7(dot)6090108(at)archonet(dot)com> (Richard Huxton's message of "Mon, 06 Nov 2006 14:34:31 +0000")
Message-ID: <827iy8xzjm(dot)fsf(at)mid(dot)bfk(dot)de>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Virus-Scanned: Maia Mailguard 1.0.1
X-Archive-Number: 200611/324
X-Sequence-Number: 103420

* Richard Huxton:

> I take it SELECT DISTINCT bar... shows the same problem?

SELECT bar FROM baz does *not* show the duplicate row.

> If so, can you do:
> SELECT OID,xmin,cmin,xmax,cmax,bar FROM baz
> WHERE bar =3D <something with duplicates>

Even if I force a complete index scan, I get xmin =3D 1007617 for both
rows, the others are zero. The table hasn't got OIDs.

--=20
Florian Weimer <fweimer(at)bfk(dot)de>
BFK edv-consulting GmbH http://www.bfk.de/
Kriegsstra=DFe 100 tel: +49-721-96201-1
D-76133 Karlsruhe fax: +49-721-96201-99


From: Desmond Coughlan <coughlandesmond(at)yahoo(dot)fr>
To: Ben <bench(at)silentmedia(dot)com>
Cc: pgsql mailing list <pgsql-general(at)postgresql(dot)org>
Subject: RE : Re: first steps in PhP and PostgreSQL
Date: 2006-11-07 09:13:22
Message-ID: 20061107091322.12071.qmail@web23101.mail.ird.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

X-No-Archive: true

Yep...

192.168.0.254 - - [07/Nov/2006:10:12:57 +0100] "GET /php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"

D.

Ben <bench(at)silentmedia(dot)com> a écrit :
Have you checked your webserver error logs?

On Mon, 6 Nov 2006, Desmond Coughlan wrote:

> X-No-Archive: true
>
> Hi,
> I'm sure that it's a typo or something, but as I'm getting into PhP and PostgreSQL for the first time, I can't be sure.
>
> I have a db, called 'cdi' ..
>
> A 'SELECT * FROM stock;' gets me this in psql ..
>
> cdi=> SELECT * from stock ;
> -[ RECORD 1 ]-+-------------------------------
> stock_ids | 1
> isbn_no | 10101010
> code_livre | 23455
> titre | toto goes to Hollywood
> editeur | editions toto
> collection | collection toto
> auteur_nom | smith
> auteur_prenom | john
> matiere | ang
> media_type | li
> -[ RECORD 2 ]-+-------------------------------
> stock_ids | 2
> isbn_no | 10536278
> code_livre | 24874
> titre | toto comes back from Hollywood
> editeur | editions baba
> collection | collection toto
> auteur_nom | martin
> auteur_prenom | peter
> matiere | fre
> media_type | dvd
>
> So the db is populated. I now do this in a file called base.php ..
>
> > pg_connect ("dbname=cdi user=cdi password=toto") or die
> ("Couldn't Connect: ".pg_last_error());
> $query="SELECT * FROM stock";
> $query=pg_query($query);
> // start the output
> while($row=pg_fetch_array($query,NULL,PGSQL_ASSOC)) {
> echo "Title: ".$row['isbn_no']."
";
> echo "blah ".$row['code_livre']."
";
> }
> ?>
>
>
>
> I copy that file to my apache server, in php_experimental/base.php and access it via a browser.
>
> I don't get an error message. I instead get a blank page.
>
> Your advice would be welcome.
>
> D.
>
>
> ---------------------------------
> Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

--
Des Coughlan
coughlandesmond(at)yahoo(dot)fr

"Un client de plus, c'est un relou de plus..."


---------------------------------
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.


From: Ben <bench(at)silentmedia(dot)com>
To: Desmond Coughlan <coughlandesmond(at)yahoo(dot)fr>
Cc: pgsql mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: RE : Re: first steps in PhP and PostgreSQL
Date: 2006-11-07 16:55:06
Message-ID: Pine.LNX.4.64.0611070854540.8155@GRD.cube42.tai.silentmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

No, that's the access log. Check the error log.

On Tue, 7 Nov 2006, Desmond Coughlan wrote:

> X-No-Archive: true
>
> Yep...
>
> 192.168.0.254 - - [07/Nov/2006:10:12:57 +0100] "GET /php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
>
> D.
>
> Ben <bench(at)silentmedia(dot)com> a écrit :
> Have you checked your webserver error logs?
>
> On Mon, 6 Nov 2006, Desmond Coughlan wrote:
>
>> X-No-Archive: true
>>
>> Hi,
>> I'm sure that it's a typo or something, but as I'm getting into PhP and PostgreSQL for the first time, I can't be sure.
>>
>> I have a db, called 'cdi' ..
>>
>> A 'SELECT * FROM stock;' gets me this in psql ..
>>
>> cdi=> SELECT * from stock ;
>> -[ RECORD 1 ]-+-------------------------------
>> stock_ids | 1
>> isbn_no | 10101010
>> code_livre | 23455
>> titre | toto goes to Hollywood
>> editeur | editions toto
>> collection | collection toto
>> auteur_nom | smith
>> auteur_prenom | john
>> matiere | ang
>> media_type | li
>> -[ RECORD 2 ]-+-------------------------------
>> stock_ids | 2
>> isbn_no | 10536278
>> code_livre | 24874
>> titre | toto comes back from Hollywood
>> editeur | editions baba
>> collection | collection toto
>> auteur_nom | martin
>> auteur_prenom | peter
>> matiere | fre
>> media_type | dvd
>>
>> So the db is populated. I now do this in a file called base.php ..
>>
>>> pg_connect ("dbname=cdi user=cdi password=toto") or die
>> ("Couldn't Connect: ".pg_last_error());
>> $query="SELECT * FROM stock";
>> $query=pg_query($query);
>> // start the output
>> while($row=pg_fetch_array($query,NULL,PGSQL_ASSOC)) {
>> echo "Title: ".$row['isbn_no']."
> ";
>> echo "blah ".$row['code_livre']."
> ";
>> }
>> ?>
>>
>>
>>
>> I copy that file to my apache server, in php_experimental/base.php and access it via a browser.
>>
>> I don't get an error message. I instead get a blank page.
>>
>> Your advice would be welcome.
>>
>> D.
>>
>>
>> ---------------------------------
>> Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>
>
> --
> Des Coughlan
> coughlandesmond(at)yahoo(dot)fr
>
> "Un client de plus, c'est un relou de plus..."
>
>
> ---------------------------------
> Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
>From pgsql-general-owner(at)postgresql(dot)org Tue Nov 7 14:00:36 2006
Received: from localhost (pluto.hub.org [200.46.204.4])
by postgresql.org (Postfix) with ESMTP id 59BCC9FA173
for <pgsql-general-postgresql(dot)org(at)postgresql(dot)org>; Tue, 7 Nov 2006 14:00:35 -0400 (AST)
Received: from postgresql.org ([200.46.204.71])
by localhost (mx1.hub.org [200.46.204.4]) (amavisd-new, port 10024)
with ESMTP id 68541-09 for <pgsql-general-postgresql(dot)org(at)postgresql(dot)org>;
Tue, 7 Nov 2006 14:00:32 -0400 (AST)
X-Greylist: domain auto-whitelisted by SQLgrey-
Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.225])
by postgresql.org (Postfix) with ESMTP id 272C39FA14D
for <pgsql-general(at)postgresql(dot)org>; Tue, 7 Nov 2006 14:00:29 -0400 (AST)
Received: by wr-out-0506.google.com with SMTP id i31so402535wra
for <pgsql-general(at)postgresql(dot)org>; Tue, 07 Nov 2006 10:00:29 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=beta; d=gmail.com;
h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references;
b=NbYJUnl9Ri4p7VvPyjX4HHoLSYy/VvIqw+szjNuU69IYMIv2rbEXR8JYoO5uaCuRc6f3f2jaftaq79PP7nKqkboxRZlP68PgJEZJ8isjsiO5HGhaxeBOfJI8kdnlEhInl6Wri4VrbSG7wc6xneMTDwo13pqH+D1Fw+kPhKuhmoo=
Received: by 10.65.176.7 with SMTP id d7mr8226807qbp.1162922427978;
Tue, 07 Nov 2006 10:00:27 -0800 (PST)
Received: by 10.65.212.16 with HTTP; Tue, 7 Nov 2006 10:00:27 -0800 (PST)
Message-ID: <bc63ad820611071000r76416ac9yd3237c411ebced91(at)mail(dot)gmail(dot)com>
Date: Tue, 7 Nov 2006 16:00:27 -0200
From: "=?ISO-8859-1?Q?William_Leite_Ara=FAjo?=" <william(dot)bh(at)gmail(dot)com>
To: "Alain Roger" <raf(dot)news(at)gmail(dot)com>
Subject: Re: FOR ... IN
Cc: pgsql-general(at)postgresql(dot)org
In-Reply-To: <75645bbb0611070918j27a83430oab11cc7a76d5aad2(at)mail(dot)gmail(dot)com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_10487_10731000.1162922427839"
References: <75645bbb0611061139q73727900na9239de37c4e5a6a(at)mail(dot)gmail(dot)com>
<bc63ad820611070229v59286d05n7db70c7039262a93(at)mail(dot)gmail(dot)com>
<75645bbb0611070918j27a83430oab11cc7a76d5aad2(at)mail(dot)gmail(dot)com>
X-Virus-Scanned: Maia Mailguard 1.0.1
X-Archive-Number: 200611/380
X-Sequence-Number: 103476

------=_Part_10487_10731000.1162922427839
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

2006/11/7, Alain Roger <raf(dot)news(at)gmail(dot)com>:
>
> but there is already a RETURN NEXT res;
> so what will be the point of this RETURN after the END LOOP; ?

http://www.postgresql.org/docs/8.1/interactive/plpgsql-control-structures.h=
tml

--=20
William Leite Ara=FAjo

------=_Part_10487_10731000.1162922427839
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

2006/11/7, Alain Roger &lt;<a href=3D"mailto:raf(dot)news(at)gmail(dot)com">raf(dot)news(at)g=
mail.com</a>&gt;:<div><span class=3D"gmail_quote"></span><blockquote class=
=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin=
: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
but there is already a RETURN NEXT res;<br>so what will be the point of thi=
s RETURN after the END LOOP; ?</blockquote><div><br><a href=3D"http://www.p=
ostgresql.org/docs/8.1/interactive/plpgsql-control-structures.html">http://=
www.postgresql.org/docs/8.1/interactive/plpgsql-control-structures.html
</a><br><br><br></div></div><br clear=3D"all"><br>-- <br>William Leite Ara=
=FAjo<br>

------=_Part_10487_10731000.1162922427839--


From: Desmond Coughlan <coughlandesmond(at)yahoo(dot)fr>
To: Ben <bench(at)silentmedia(dot)com>
Cc: pgsql mailing list <pgsql-general(at)postgresql(dot)org>
Subject: RE : Re: RE : Re: first steps in PhP and PostgreSQL
Date: 2006-11-08 08:33:34
Message-ID: 20061108083334.87613.qmail@web23113.mail.ird.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

X-No-Archive: true

Ah...

[Wed Nov 08 09:32:56 2006] [error] [client 192.168.0.254] PHP Fatal error: Call to undefined function: pg_connect() in /usr/local/www/data/php_experimental/base.php on line 6

Ben <bench(at)silentmedia(dot)com> a écrit :
No, that's the access log. Check the error log.

On Tue, 7 Nov 2006, Desmond Coughlan wrote:

> X-No-Archive: true
>
> Yep...
>
> 192.168.0.254 - - [07/Nov/2006:10:12:57 +0100] "GET /php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
>
> D.
>
> Ben a écrit :
> Have you checked your webserver error logs?
>
> On Mon, 6 Nov 2006, Desmond Coughlan wrote:
>
>> X-No-Archive: true
>>
>> Hi,
>> I'm sure that it's a typo or something, but as I'm getting into PhP and PostgreSQL for the first time, I can't be sure.
>>
>> I have a db, called 'cdi' ..
>>
>> A 'SELECT * FROM stock;' gets me this in psql ..
>>
>> cdi=> SELECT * from stock ;
>> -[ RECORD 1 ]-+-------------------------------
>> stock_ids | 1
>> isbn_no | 10101010
>> code_livre | 23455
>> titre | toto goes to Hollywood
>> editeur | editions toto
>> collection | collection toto
>> auteur_nom | smith
>> auteur_prenom | john
>> matiere | ang
>> media_type | li
>> -[ RECORD 2 ]-+-------------------------------
>> stock_ids | 2
>> isbn_no | 10536278
>> code_livre | 24874
>> titre | toto comes back from Hollywood
>> editeur | editions baba
>> collection | collection toto
>> auteur_nom | martin
>> auteur_prenom | peter
>> matiere | fre
>> media_type | dvd
>>
>> So the db is populated. I now do this in a file called base.php ..
>>
>>> pg_connect ("dbname=cdi user=cdi password=toto") or die
>> ("Couldn't Connect: ".pg_last_error());
>> $query="SELECT * FROM stock";
>> $query=pg_query($query);
>> // start the output
>> while($row=pg_fetch_array($query,NULL,PGSQL_ASSOC)) {
>> echo "Title: ".$row['isbn_no']."
> ";
>> echo "blah ".$row['code_livre']."
> ";
>> }
>> ?>
>>
>>
>>
>> I copy that file to my apache server, in php_experimental/base.php and access it via a browser.
>>
>> I don't get an error message. I instead get a blank page.
>>
>> Your advice would be welcome.
>>
>> D.
>>
>>
>> ---------------------------------
>> Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>
>
> --
> Des Coughlan
> coughlandesmond(at)yahoo(dot)fr
>
> "Un client de plus, c'est un relou de plus..."
>
>
> ---------------------------------
> Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.


---------------------------------
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.