Re: RE : Re: first steps in PhP and PostgreSQL

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
Thread:
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--

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alain Roger 2006-11-07 18:24:27 Re: FOR ... IN
Previous Message Bart McFarling 2006-11-07 16:12:57 Linux vs. FreeBSD