first steps in PhP and PostgreSQL

Поиск
Список
Период
Сортировка
От Desmond Coughlan
Тема first steps in PhP and PostgreSQL
Дата
Msg-id 20061106140525.59034.qmail@web23110.mail.ird.yahoo.com
обсуждение исходный текст
Ответы Re: first steps in PhP and PostgreSQL  (Bill Moran <wmoran@collaborativefusion.com>)
Re: first steps in PhP and PostgreSQL  (Roman Neuhauser <neuhauser@sigpipe.cz>)
Re: first steps in PhP and PostgreSQL  (Richard Huxton <dev@archonet.com>)
Re: first steps in PhP and PostgreSQL  (Ben <bench@silentmedia.com>)
Список 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.

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: postmaster slowing down
Следующее
От: Bill Moran
Дата:
Сообщение: Re: first steps in PhP and PostgreSQL