Re: first steps in PhP and PostgreSQL

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Roman Neuhauser 2006-11-06 16:24:46 Re: Dump all databases to corresponding files
Previous Message Joshua D. Drake 2006-11-06 16:07:27 Re: PostGIS Binary RPM for Red Hat Linux