re: small question php/postgreSQL (basic question, not small)
re: small question php/postgreSQL (basic question, not small)
am 07.11.2006 13:18:58 von jusa_98
--0-914778041-1162901938=:29608
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Date: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: "Desmond Coughlan" To: "php" Subject: small question php/postgreSQL
Hi,
I've been trying to get a small DB up and working with PhP. It's a
library, and so far, I can't get past the stage of displaying a page. I
try the 'hello world' example, and it displays. I then populate a DB
and can access it via 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
OK, I then write the following script ....
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']."
";
}
?>
(sorry not to put that in italics or whatever...)
... and put it in the document root of my webserver, under
php_experimental.
I get a blank page. The apache weblogs look like ...
192.168.0.254 - - [07/Nov/2006:10:37:30 +0100] "GET
/php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.0)"
There's something obvious that I'm missing. Any ideas ..?
Thanks.
D.
------
re:
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']."
";
}
?>
Simple, isbn_no and code_livre need to be "defined" in your code. Otherwise PHP don't know what your looking for.
There is PLENTY of docs online to show you how to display items in a DB. Hello World is basic, too basic to use as an example and is a poor one to use. If your nerw you have to go a bit more into it than Hello World code. (which in my opinion gets you know-where) been there done that.
Google how to display items in a DB in PHP and shoot you get some handy things.
I just feel this question is not required here when google has all the answers like this.
Jerry
--0-914778041-1162901938=:29608--
RE: re: small question php/postgreSQL (basic question, not small)
am 07.11.2006 16:01:30 von Bastien Koert
The code does need to know what the fields are...I think a more likely issue
is the query for some reason, also change the $query to result in the query
statement
try
$result=pg_query($query) or die(pg_error()); //to see if there are any
errors with the query
while($row=pg_fetch_array($result,NULL,PGSQL_ASSOC)) {
echo "Title: ".$row['isbn_no']."
";
echo "blah ".$row['code_livre']."
";
}else{
echo "No rows found";
}
bastien
>From: JeRRy
>To: php-db@lists.php.net
>Subject: [PHP-DB] re: small question php/postgreSQL (basic question, not
>small)
>Date: Tue, 7 Nov 2006 23:18:58 +1100 (EST)
>
> Date: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: "Desmond
>Coughlan" To: "php"
> Subject: small question php/postgreSQL
> Hi,
>
> I've been trying to get a small DB up and working with PhP. It's a
>library, and so far, I can't get past the stage of displaying a page. I
>try the 'hello world' example, and it displays. I then populate a DB
>and can access it via 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
>
> OK, I then write the following script ....
>
>
> 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']."
";
>}
> ?>
>
> (sorry not to put that in italics or whatever...)
>
> ... and put it in the document root of my webserver, under
>php_experimental.
>
> I get a blank page. The apache weblogs look like ...
>
> 192.168.0.254 - - [07/Nov/2006:10:37:30 +0100] "GET
>/php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible;
>MSIE 6.0;
>Windows NT 5.0)"
>
> There's something obvious that I'm missing. Any ideas ..?
>
>Thanks.
>
>D.
>
>------
>
> re:
>
>
> 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']."
";
>}
> ?>
>
> Simple, isbn_no and code_livre need to be "defined" in your code.
>Otherwise PHP don't know what your looking for.
>
> There is PLENTY of docs online to show you how to display items in a DB.
> Hello World is basic, too basic to use as an example and is a poor one to
>use. If your nerw you have to go a bit more into it than Hello World code.
> (which in my opinion gets you know-where) been there done that.
>
> Google how to display items in a DB in PHP and shoot you get some handy
>things.
>
> I just feel this question is not required here when google has all the
>answers like this.
>
> Jerry
____________________________________________________________ _____
Ready for the world's first international mobile film festival celebrating
the creative potential of today's youth? Check out Mobile Jam Fest for your
a chance to WIN $10,000! www.mobilejamfest.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE : RE: [PHP-DB] re: small question php/postgreSQL (basic question, not small)
am 07.11.2006 16:38:24 von coughlandesmond
--0-1482775600-1162913904=:92168
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-No-Archive: true
That doesn't work, either. Still the blank page. Hmm ... the file is in the right place../usr/local/www/data ... 'cos all of the other files (*.html one an d all) are served from there, and they're available to the outside world.
D.
Bastien Koert a écrit :
The code does need to know what the fields are...I think a more likely issue
is the query for some reason, also change the $query to result in the query
statement
try
$result=pg_query($query) or die(pg_error()); //to see if there are any
errors with the query
while($row=pg_fetch_array($result,NULL,PGSQL_ASSOC)) {
echo "Title: ".$row['isbn_no']."
";
echo "blah ".$row['code_livre']."
";
}else{
echo "No rows found";
}
bastien
>From: JeRRy
>To: php-db@lists.php.net
>Subject: [PHP-DB] re: small question php/postgreSQL (basic question, not
>small)
>Date: Tue, 7 Nov 2006 23:18:58 +1100 (EST)
>
> Date: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: "Desmond
>Coughlan" To: "php"
> Subject: small question php/postgreSQL
> Hi,
>
> I've been trying to get a small DB up and working with PhP. It's a
>library, and so far, I can't get past the stage of displaying a page. I
>try the 'hello world' example, and it displays. I then populate a DB
>and can access it via 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
>
> OK, I then write the following script ....
>
> > 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']."
";
>}
> ?>
>
> (sorry not to put that in italics or whatever...)
>
> ... and put it in the document root of my webserver, under
>php_experimental.
>
> I get a blank page. The apache weblogs look like ...
>
> 192.168.0.254 - - [07/Nov/2006:10:37:30 +0100] "GET
>/php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible;
>MSIE 6.0;
>Windows NT 5.0)"
>
> There's something obvious that I'm missing. Any ideas ..?
>
>Thanks.
>
>D.
>
>------
>
> re:
>
> > 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']."
";
>}
> ?>
>
> Simple, isbn_no and code_livre need to be "defined" in your code.
>Otherwise PHP don't know what your looking for.
>
> There is PLENTY of docs online to show you how to display items in a DB.
> Hello World is basic, too basic to use as an example and is a poor one to
>use. If your nerw you have to go a bit more into it than Hello World code.
> (which in my opinion gets you know-where) been there done that.
>
> Google how to display items in a DB in PHP and shoot you get some handy
>things.
>
> I just feel this question is not required here when google has all the
>answers like this.
>
> Jerry
____________________________________________________________ _____
Ready for the world's first international mobile film festival celebrating
the creative potential of today's youth? Check out Mobile Jam Fest for your
a chance to WIN $10,000! www.mobilejamfest.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---------------------------------
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.
--0-1482775600-1162913904=:92168--
RE: RE : RE: [PHP-DB] re: small question php/postgreSQL (basicquestion, not small)
am 07.11.2006 16:45:49 von Bastien Koert
is your server set to work with php files?
Bastien
>From: Desmond Coughlan
>To: Bastien Koert , jusa_98@yahoo.com,
>php-db@lists.php.net
>Subject: [PHP-DB] RE : RE: [PHP-DB] re: small question php/postgreSQL
>(basic question, not small)
>Date: Tue, 7 Nov 2006 16:38:24 +0100 (CET)
>
>X-No-Archive: true
>
> That doesn't work, either. Still the blank page. Hmm ... the file is
>in the right place../usr/local/www/data ... 'cos all of the other files
>(*.html one an d all) are served from there, and they're available to the
>outside world.
>
> D.
>
>Bastien Koert a écrit :
> The code does need to know what the fields are...I think a more likely
>issue
>is the query for some reason, also change the $query to result in the query
>statement
>
>try
>
>$result=pg_query($query) or die(pg_error()); //to see if there are any
>errors with the query
>
>while($row=pg_fetch_array($result,NULL,PGSQL_ASSOC)) {
>echo "Title: ".$row['isbn_no']."
>";
>echo "blah ".$row['code_livre']."
>";
>}else{
>echo "No rows found";
>}
>
>
>bastien
>
>
> >From: JeRRy
> >To: php-db@lists.php.net
> >Subject: [PHP-DB] re: small question php/postgreSQL (basic question, not
> >small)
> >Date: Tue, 7 Nov 2006 23:18:58 +1100 (EST)
> >
> > Date: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: "Desmond
> >Coughlan" To: "php"
>
> > Subject: small question php/postgreSQL
> > Hi,
> >
> > I've been trying to get a small DB up and working with PhP. It's a
> >library, and so far, I can't get past the stage of displaying a page. I
> >try the 'hello world' example, and it displays. I then populate a DB
> >and can access it via 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
> >
> > OK, I then write the following script ....
> >
> > > 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']."
>";
> >}
> > ?>
> >
> > (sorry not to put that in italics or whatever...)
> >
> > ... and put it in the document root of my webserver, under
> >php_experimental.
> >
> > I get a blank page. The apache weblogs look like ...
> >
> > 192.168.0.254 - - [07/Nov/2006:10:37:30 +0100] "GET
> >/php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible;
> >MSIE 6.0;
> >Windows NT 5.0)"
> >
> > There's something obvious that I'm missing. Any ideas ..?
> >
> >Thanks.
> >
> >D.
> >
> >------
> >
> > re:
> >
> > > 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']."
>";
> >}
> > ?>
> >
> > Simple, isbn_no and code_livre need to be "defined" in your code.
> >Otherwise PHP don't know what your looking for.
> >
> > There is PLENTY of docs online to show you how to display items in a DB.
> > Hello World is basic, too basic to use as an example and is a poor one
>to
> >use. If your nerw you have to go a bit more into it than Hello World
>code.
> > (which in my opinion gets you know-where) been there done that.
> >
> > Google how to display items in a DB in PHP and shoot you get some handy
> >things.
> >
> > I just feel this question is not required here when google has all the
> >answers like this.
> >
> > Jerry
>
>___________________________________________________________ ______
>Ready for the world's first international mobile film festival celebrating
>the creative potential of today's youth? Check out Mobile Jam Fest for your
>a chance to WIN $10,000! www.mobilejamfest.com
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>---------------------------------
> 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.
____________________________________________________________ _____
Not only does Windows Live OneCare provide all-in-one PC care to keep your
computer protected and well-maintained, but it also makes creating backup
files a breeze. Try it today!
http://ideas.live.com/programpage.aspx?versionid=b2456790-90 e6-4d28-9219-5d7207d94d45&mkt=en-ca
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE : RE: [PHP-DB] RE : RE: [PHP-DB] re: small question php/postgreSQL (basic question, not small)
am 07.11.2006 16:47:05 von coughlandesmond
--0-656812908-1162914425=:98800
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-No-Archive: true
Yep. The famous phpinfo file works like a charm.
D.
Bastien Koert a écrit :
is your server set to work with php files?
Bastien
>From: Desmond Coughlan
>To: Bastien Koert , jusa_98@yahoo.com,
>php-db@lists.php.net
>Subject: [PHP-DB] RE : RE: [PHP-DB] re: small question php/postgreSQL
>(basic question, not small)
>Date: Tue, 7 Nov 2006 16:38:24 +0100 (CET)
>
>X-No-Archive: true
>
> That doesn't work, either. Still the blank page. Hmm ... the file is
>in the right place../usr/local/www/data ... 'cos all of the other files
>(*.html one an d all) are served from there, and they're available to the
>outside world.
>
> D.
>
>Bastien Koert a écrit :
> The code does need to know what the fields are...I think a more likely
>issue
>is the query for some reason, also change the $query to result in the query
>statement
>
>try
>
>$result=pg_query($query) or die(pg_error()); //to see if there are any
>errors with the query
>
>while($row=pg_fetch_array($result,NULL,PGSQL_ASSOC)) {
>echo "Title: ".$row['isbn_no']."
>";
>echo "blah ".$row['code_livre']."
>";
>}else{
>echo "No rows found";
>}
>
>
>bastien
>
>
> >From: JeRRy
> >To: php-db@lists.php.net
> >Subject: [PHP-DB] re: small question php/postgreSQL (basic question, not
> >small)
> >Date: Tue, 7 Nov 2006 23:18:58 +1100 (EST)
> >
> > Date: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: "Desmond
> >Coughlan" To: "php"
>
> > Subject: small question php/postgreSQL
> > Hi,
> >
> > I've been trying to get a small DB up and working with PhP. It's a
> >library, and so far, I can't get past the stage of displaying a page. I
> >try the 'hello world' example, and it displays. I then populate a DB
> >and can access it via 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
> >
> > OK, I then write the following script ....
> >
> > > 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']."
>";
> >}
> > ?>
> >
> > (sorry not to put that in italics or whatever...)
> >
> > ... and put it in the document root of my webserver, under
> >php_experimental.
> >
> > I get a blank page. The apache weblogs look like ...
> >
> > 192.168.0.254 - - [07/Nov/2006:10:37:30 +0100] "GET
> >/php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible;
> >MSIE 6.0;
> >Windows NT 5.0)"
> >
> > There's something obvious that I'm missing. Any ideas ..?
> >
> >Thanks.
> >
> >D.
> >
> >------
> >
> > re:
> >
> > > 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']."
>";
> >}
> > ?>
> >
> > Simple, isbn_no and code_livre need to be "defined" in your code.
> >Otherwise PHP don't know what your looking for.
> >
> > There is PLENTY of docs online to show you how to display items in a DB.
> > Hello World is basic, too basic to use as an example and is a poor one
>to
> >use. If your nerw you have to go a bit more into it than Hello World
>code.
> > (which in my opinion gets you know-where) been there done that.
> >
> > Google how to display items in a DB in PHP and shoot you get some handy
> >things.
> >
> > I just feel this question is not required here when google has all the
> >answers like this.
> >
> > Jerry
>
>___________________________________________________________ ______
>Ready for the world's first international mobile film festival celebrating
>the creative potential of today's youth? Check out Mobile Jam Fest for your
>a chance to WIN $10,000! www.mobilejamfest.com
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>---------------------------------
> 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.
____________________________________________________________ _____
Not only does Windows Live OneCare provide all-in-one PC care to keep your
computer protected and well-maintained, but it also makes creating backup
files a breeze. Try it today!
http://ideas.live.com/programpage.aspx?versionid=b2456790-90 e6-4d28-9219-5d7207d94d45&mkt=en-ca
--
Des Coughlan
coughlandesmond@yahoo.fr
"Un client de plus, c'est un relou de plus..."
---------------------------------
Marre d'une boite pleine de spams ? Adoptez le tout nouveau Yahoo! Mail et son son filtre anti-spams perfectionnés.
--0-656812908-1162914425=:98800--
Re: : small question php/postgreSQL
am 07.11.2006 16:49:03 von Tony Grimes
Is your server configured to display errors? Try adding this at the top of
your script:
ini_set('display_errors',true);
It won't catch syntax errors, but it should help. Also, try adding this to
the top of your script:
echo 'test';
If you still get a blank page, then it's probably not a problem with your
actual script. Maybe your configuration.
Tony
On 11/7/06 8:38 AM, "Desmond Coughlan" wrote:
> X-No-Archive: true
> =20
> That doesn't work, either. Still the blank page. Hmm ... the file is in=
the
> right place../usr/local/www/data ... 'cos all of the other files (*.html =
one
> an d all) are served from there, and they're available to the outside wor=
ld.
> =20
> D.
>=20
> Bastien Koert a =E9crit :
> The code does need to know what the fields are...I think a more likely is=
sue
> is the query for some reason, also change the $query to result in the que=
ry
> statement
>=20
> try
>=20
> $result=3Dpg_query($query) or die(pg_error()); //to see if there are any
> errors with the query
>=20
> while($row=3Dpg_fetch_array($result,NULL,PGSQL_ASSOC)) {
> echo "Title: ".$row['isbn_no']."
> ";
> echo "blah ".$row['code_livre']."
> ";
> }else{
> echo "No rows found";
> }
>=20
>=20
> bastien
>=20
>=20
>> From: JeRRy=20
>> To: php-db@lists.php.net
>> Subject: [PHP-DB] re: small question php/postgreSQL (basic question, not
>> small)
>> Date: Tue, 7 Nov 2006 23:18:58 +1100 (EST)
>>=20
>> Date: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: "Desmond
>> Coughlan" To: "php"
>=20
>> Subject: small question php/postgreSQL
>> Hi,
>>=20
>> I've been trying to get a small DB up and working with PhP. It's a
>> library, and so far, I can't get past the stage of displaying a page. I
>> try the 'hello world' example, and it displays. I then populate a DB
>> and can access it via psql ..
>>=20
>> cdi=3D> 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
>>=20
>> OK, I then write the following script ....
>>=20
>>> pg_connect ("dbname=3Dcdi user=3Dcdi password=3Dtoto") or die ("Couldn't
>> Connect: ".pg
>> _last_error());
>> $query=3D"SELECT * FROM stock";
>> $query=3Dpg_query($query);
>> // start the output
>> while($row=3Dpg_fetch_array($query,NULL,PGSQL_ASSOC)) {
>> echo "Title: ".$row['isbn_no']."
> ";
>> echo "blah ".$row['code_livre']."
> ";
>> }
>> ?>
>>=20
>> (sorry not to put that in italics or whatever...)
>>=20
>> ... and put it in the document root of my webserver, under
>> php_experimental.
>>=20
>> I get a blank page. The apache weblogs look like ...
>>=20
>> 192.168.0.254 - - [07/Nov/2006:10:37:30 +0100] "GET
>> /php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible;
>> MSIE 6.0;
>> Windows NT 5.0)"
>>=20
>> There's something obvious that I'm missing. Any ideas ..?
>>=20
>> Thanks.
>>=20
>> D.
>>=20
>> ------
>>=20
>> re:
>>=20
>>> pg_connect ("dbname=3Dcdi user=3Dcdi password=3Dtoto") or die ("Couldn't
>> Connect: ".pg
>> _last_error());
>> $query=3D"SELECT * FROM stock";
>> $query=3Dpg_query($query);
>> // start the output
>> while($row=3Dpg_fetch_array($query,NULL,PGSQL_ASSOC)) {
>> echo "Title: ".$row['isbn_no']."
> ";
>> echo "blah ".$row['code_livre']."
> ";
>> }
>> ?>
>>=20
>> Simple, isbn_no and code_livre need to be "defined" in your code.
>> Otherwise PHP don't know what your looking for.
>>=20
>> There is PLENTY of docs online to show you how to display items in a DB.
>> Hello World is basic, too basic to use as an example and is a poor one t=
o
>> use. If your nerw you have to go a bit more into it than Hello World cod=
e.
>> (which in my opinion gets you know-where) been there done that.
>>=20
>> Google how to display items in a DB in PHP and shoot you get some handy
>> things.
>>=20
>> I just feel this question is not required here when google has all the
>> answers like this.
>>=20
>> Jerry
>=20
> ____________________________________________________________ _____
> Ready for the world's first international mobile film festival celebratin=
g
> the creative potential of today's youth? Check out Mobile Jam Fest for yo=
ur
> a chance to WIN $10,000! www.mobilejamfest.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE : Re: [PHP-DB]: small question php/postgreSQL
am 07.11.2006 17:00:18 von coughlandesmond
--0-680545869-1162915218=:12010
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-No-Archive: true
OK, that gives a blank page, too... which is puzzling, 'cos I tried 'hello.php' before getting into the db 'thang', and I saw the text on the screen.
Well .. back to the drawing board...
D.
Tony Grimes a écrit :
Is your server configured to display errors? Try adding this at the top of
your script:
ini_set('display_errors',true);
It won't catch syntax errors, but it should help. Also, try adding this to
the top of your script:
echo 'test';
If you still get a blank page, then it's probably not a problem with your
actual script. Maybe your configuration.
Tony
On 11/7/06 8:38 AM, "Desmond Coughlan" wrote:
> X-No-Archive: true
>
> That doesn't work, either. Still the blank page. Hmm ... the file is in the
> right place../usr/local/www/data ... 'cos all of the other files (*.html one
> an d all) are served from there, and they're available to the outside world.
>
> D.
>
> Bastien Koert a écrit :
> The code does need to know what the fields are...I think a more likely issue
> is the query for some reason, also change the $query to result in the query
> statement
>
> try
>
> $result=pg_query($query) or die(pg_error()); //to see if there are any
> errors with the query
>
> while($row=pg_fetch_array($result,NULL,PGSQL_ASSOC)) {
> echo "Title: ".$row['isbn_no']."
> ";
> echo "blah ".$row['code_livre']."
> ";
> }else{
> echo "No rows found";
> }
>
>
> bastien
>
>
>> From: JeRRy
>> To: php-db@lists.php.net
>> Subject: [PHP-DB] re: small question php/postgreSQL (basic question, not
>> small)
>> Date: Tue, 7 Nov 2006 23:18:58 +1100 (EST)
>>
>> Date: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: "Desmond
>> Coughlan" To: "php"
>
>> Subject: small question php/postgreSQL
>> Hi,
>>
>> I've been trying to get a small DB up and working with PhP. It's a
>> library, and so far, I can't get past the stage of displaying a page. I
>> try the 'hello world' example, and it displays. I then populate a DB
>> and can access it via 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
>>
>> OK, I then write the following script ....
>>
>>> 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']."
> ";
>> }
>> ?>
>>
>> (sorry not to put that in italics or whatever...)
>>
>> ... and put it in the document root of my webserver, under
>> php_experimental.
>>
>> I get a blank page. The apache weblogs look like ...
>>
>> 192.168.0.254 - - [07/Nov/2006:10:37:30 +0100] "GET
>> /php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible;
>> MSIE 6.0;
>> Windows NT 5.0)"
>>
>> There's something obvious that I'm missing. Any ideas ..?
>>
>> Thanks.
>>
>> D.
>>
>> ------
>>
>> re:
>>
>>> 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']."
> ";
>> }
>> ?>
>>
>> Simple, isbn_no and code_livre need to be "defined" in your code.
>> Otherwise PHP don't know what your looking for.
>>
>> There is PLENTY of docs online to show you how to display items in a DB.
>> Hello World is basic, too basic to use as an example and is a poor one to
>> use. If your nerw you have to go a bit more into it than Hello World code.
>> (which in my opinion gets you know-where) been there done that.
>>
>> Google how to display items in a DB in PHP and shoot you get some handy
>> things.
>>
>> I just feel this question is not required here when google has all the
>> answers like this.
>>
>> Jerry
>
> ____________________________________________________________ _____
> Ready for the world's first international mobile film festival celebrating
> the creative potential of today's youth? Check out Mobile Jam Fest for your
> a chance to WIN $10,000! www.mobilejamfest.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Des Coughlan
coughlandesmond@yahoo.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.
--0-680545869-1162915218=:12010--
Re: RE : Re: [PHP-DB]: small question php/postgreSQL
am 07.11.2006 17:20:56 von Tony Grimes
Alright, now try commenting out all the script except for the ini_set and
echo 'test' at the top. There still might be a syntax error in the code.
Essentially, you want to do whatever you can to get the page to display a
simple message. Then, work backwards until you get the error/blank page.
If you can't get a message to display, try copying the script from hello.ph=
p
to right into your new script. That should give you enough to troubleshoot.
Tony
On 11/7/06 9:00 AM, "Desmond Coughlan" wrote:
> X-No-Archive: true
> =20
> OK, that gives a blank page, too... which is puzzling, 'cos I tried
> 'hello.php' before getting into the db 'thang', and I saw the text on the
> screen.
> =20
> Well .. back to the drawing board...
> =20
> D.
>=20
> Tony Grimes a =E9crit :
> Is your server configured to display errors? Try adding this at the top o=
f
> your script:
>=20
> ini_set('display_errors',true);
>=20
> It won't catch syntax errors, but it should help. Also, try adding this t=
o
> the top of your script:
>=20
> echo 'test';
>=20
> If you still get a blank page, then it's probably not a problem with your
> actual script. Maybe your configuration.
>=20
> Tony
>=20
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE : Re: [PHP-DB]: small question php/postgreSQL
am 07.11.2006 17:27:50 von coughlandesmond
--0-2102447011-1162916870=:27074
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-No-Archive:
Curious. I put this in a file...
echo '
Hello World
'
?>
Bingo.
I then take the *same* file, I don't rename it, I just open it in vi. I copy a single occurrence of 'pg_connect' etc...
And the 'hello world' disappears.
D.
Tony Grimes a écrit :
Is your server configured to display errors? Try adding this at the top of
your script:
ini_set('display_errors',true);
It won't catch syntax errors, but it should help. Also, try adding this to
the top of your script:
echo 'test';
If you still get a blank page, then it's probably not a problem with your
actual script. Maybe your configuration.
Tony
On 11/7/06 8:38 AM, "Desmond Coughlan" wrote:
> X-No-Archive: true
>
> That doesn't work, either. Still the blank page. Hmm ... the file is in the
> right place../usr/local/www/data ... 'cos all of the other files (*.html one
> an d all) are served from there, and they're available to the outside world.
>
> D.
>
> Bastien Koert a écrit :
> The code does need to know what the fields are...I think a more likely issue
> is the query for some reason, also change the $query to result in the query
> statement
>
> try
>
> $result=pg_query($query) or die(pg_error()); //to see if there are any
> errors with the query
>
> while($row=pg_fetch_array($result,NULL,PGSQL_ASSOC)) {
> echo "Title: ".$row['isbn_no']."
> ";
> echo "blah ".$row['code_livre']."
> ";
> }else{
> echo "No rows found";
> }
>
>
> bastien
>
>
>> From: JeRRy
>> To: php-db@lists.php.net
>> Subject: [PHP-DB] re: small question php/postgreSQL (basic question, not
>> small)
>> Date: Tue, 7 Nov 2006 23:18:58 +1100 (EST)
>>
>> Date: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: "Desmond
>> Coughlan" To: "php"
>
>> Subject: small question php/postgreSQL
>> Hi,
>>
>> I've been trying to get a small DB up and working with PhP. It's a
>> library, and so far, I can't get past the stage of displaying a page. I
>> try the 'hello world' example, and it displays. I then populate a DB
>> and can access it via 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
>>
>> OK, I then write the following script ....
>>
>>> 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']."
> ";
>> }
>> ?>
>>
>> (sorry not to put that in italics or whatever...)
>>
>> ... and put it in the document root of my webserver, under
>> php_experimental.
>>
>> I get a blank page. The apache weblogs look like ...
>>
>> 192.168.0.254 - - [07/Nov/2006:10:37:30 +0100] "GET
>> /php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible;
>> MSIE 6.0;
>> Windows NT 5.0)"
>>
>> There's something obvious that I'm missing. Any ideas ..?
>>
>> Thanks.
>>
>> D.
>>
>> ------
>>
>> re:
>>
>>> 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']."
> ";
>> }
>> ?>
>>
>> Simple, isbn_no and code_livre need to be "defined" in your code.
>> Otherwise PHP don't know what your looking for.
>>
>> There is PLENTY of docs online to show you how to display items in a DB.
>> Hello World is basic, too basic to use as an example and is a poor one to
>> use. If your nerw you have to go a bit more into it than Hello World code.
>> (which in my opinion gets you know-where) been there done that.
>>
>> Google how to display items in a DB in PHP and shoot you get some handy
>> things.
>>
>> I just feel this question is not required here when google has all the
>> answers like this.
>>
>> Jerry
>
> ____________________________________________________________ _____
> Ready for the world's first international mobile film festival celebrating
> the creative potential of today's youth? Check out Mobile Jam Fest for your
> a chance to WIN $10,000! www.mobilejamfest.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---------------------------------
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.
--0-2102447011-1162916870=:27074--
Re: : small question php/postgreSQL
am 07.11.2006 17:38:30 von Tony Grimes
--B_3245737111_78963039
Content-type: text/plain; charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable
You should turn on display_errors in your php.ini file. That would make it =
a
lot easier to track down the error.
Tony
On 11/7/06 9:27 AM, "Desmond Coughlan" wrote:
> X-No-Archive:
> =20
>=20
> Curious. I put this in a file...
> =20
> =20
> =20
>
> =20
> echo 'Hello World
'
> =20
> ?>
> =20
> Bingo. =20
> =20
> =20
> =20
> I then take the *same* file, I don't rename it, I just open it in vi. I =
copy
> a single occurrence of 'pg_connect' etc...
> =20
> =20
> =20
> And the 'hello world' disappears.
> =20
> =20
> =20
> D.
> =20
>=20
>=20
> Tony Grimes a =E9crit :
> =20
>> Is your server configured to display errors? Try adding this at the top =
of
>> your script:
>>=20
>> ini_set('display_errors',true);
>>=20
>> It won't catch syntax errors, but it should help. Also, try adding this =
to
>> the top of your script:
>>=20
>> echo 'test';
>>=20
>> If you still get a blank page, then it's probably not a problem with yo=
ur
>> actual script. Maybe your configuration.
>>=20
>> Tony
>>=20
>>=20
>> On 11/7/06 8:38 AM, "Desmond Coughlan" wrote:
>>=20
>>> > X-No-Archive: true
>>> >=20
>>> > That doesn't work, either. Still the blank page. Hmm ... the file is =
in
>>> the
>>> > right place../usr/local/www/data ... 'cos all of the other files (*.h=
tml
>>> one
>>> > an d all) are served from there, and they're available to the outside
>>> world.
>>> >=20
>>> > D.
>>> >=20
>>> > Bastien Koert a =E9crit :
>>> > The code does need to know what the fields are...I think a more likel=
y
>>> issue
>>> > is the query for some reason, also change the $query to result in the
>>> query
>>> > statement
>>> >=20
>>> > try
>>> >=20
>>> > $result=3Dpg_query($query) or die(pg_error()); //to see if there are an=
y
>>> > errors with the query
>>> >=20
>>> > while($row=3Dpg_fetch_array($result,NULL,PGSQL_ASSOC)) {
>>> > echo "Title: ".$row['isbn_no']."
>>> > ";
>>> > echo "blah ".$row['code_livre']."
>>> > ";
>>> > }else{
>>> > echo "No rows found";
>>> > }
>>> >=20
>>> >=20
>>> > bastien
>>> >=20
>>> >=20
>>>> >> From: JeRRy
>>>> >> To: php-db@lists.php.net
>>>> >> Subject: [PHP-DB] re: small question php/postgreSQL (basic question=
, not
>>>> >> small)
>>>> >> Date: Tue, 7 Nov 2006 23:18:58 +1100 (EST)
>>>> >>=20
>>>> >> Date: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: "Desmond
>>>> >> Coughlan" To: "php"
>>> >=20
>>>> >> Subject: small question php/postgreSQL
>>>> >> Hi,
>>>> >>=20
>>>> >> I've been trying to get a small DB up and working with PhP. It's a
>>>> >> library, and so far, I can't get past the stage of displaying a pag=
e. I
>>>> >> try the 'hello world' example, and it displays. I then populate a D=
B
>>>> >> and can access it via psql ..
>>>> >>=20
>>>> >> cdi=3D> 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
>>>> >>=20
>>>> >> OK, I then write the following script ....
>>>> >>=20
>>>>> >>> pg_connect ("dbname=3Dcdi user=3Dcdi password=3Dtoto") or die ("Couldn'=
t
>>>> >> Connect: ".pg
>>>> >> _last_error());
>>>> >> $query=3D"SELECT * FROM stock";
>>>> >> $query=3Dpg_query($query);
>>>> >> // start the output
>>>> >> while($row=3Dpg_fetch_array($query,NULL,PGSQL_ASSOC)) {
>>>> >> echo "Title: ".$row['isbn_no']."
>>> > ";
>>>> >> echo "blah ".$row['code_livre']."
>>> > ";
>>>> >> }
>>>> >> ?>
>>>> >>=20
>>>> >> (sorry not to put that in italics or whatever...)
>>>> >>=20
>>>> >> ... and put it in the document root of my webserver, under
>>>> >> php_experimental.
>>>> >>=20
>>>> >> I get a blank page. The apache weblogs look like ...
>>>> >>=20
>>>> >> 192.168.0.254 - - [07/Nov/2006:10:37:30 +0100] "GET
>>>> >> /php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 (compat=
ible;
>>>> >> MSIE 6.0;
>>>> >> Windows NT 5.0)"
>>>> >>=20
>>>> >> There's something obvious that I'm missing. Any ideas ..?
>>>> >>=20
>>>> >> Thanks.
>>>> >>=20
>>>> >> D.
>>>> >>=20
>>>> >> ------
>>>> >> =20
>>>> >> re:
>>>> >>=20
>>>>> >>> pg_connect ("dbname=3Dcdi user=3Dcdi password=3Dtoto") or die ("Couldn'=
t
>>>> >> Connect: ".pg
>>>> >> _last_error());
>>>> >> $query=3D"SELECT * FROM stock";
>>>> >> $query=3Dpg_query($query);
>>>> >> // start the output
>>>> >> while($row=3Dpg_fetch_array($query,NULL,PGSQL_ASSOC)) {
>>>> >> echo "Title: ".$row['isbn_no']."
>>> > ";
>>>> >> echo "blah ".$row['code_livre']."
>>> > ";
>>>> >> }
>>>> >> ?>
>>>> >>=20
>>>> >> Simple, isbn_no and code_livre need to be "defined" in your code.
>>>> >> Otherwise PHP don't know what your looking for.
>>>> >>=20
>>>> >> There is PLENTY of docs online to show you how to display items in =
a DB.
>>>> >> Hello World is basic, too basic to use as an example and is a poor =
one
to
>>>> >> use. If your nerw you have to go a bit more into it than Hello Worl=
d
>>>> code.
>>>> >> (which in my opinion gets you know-where) been there done that.
>>>> >>=20
>>>> >> Google how to display items in a DB in PHP and shoot you get some h=
andy
>>>> >> things.
>>>> >>=20
>>>> >> I just feel this question is not required here when google has all =
the
>>>> >> answers like this.
>>>> >>=20
>>>> >> Jerry
>>> >=20
>>> > ____________________________________________________________ _____
>>> > Ready for the world's first international mobile film festival celebr=
ating
>>> > the creative potential of today's youth? Check out Mobile Jam Fest fo=
r
>>> your
>>> > a chance to WIN $10,000! www.mobilejamfest.com
>>=20
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>=20
>=20
>=20
> =20
>=20
> D=E9couvrez une nouvelle fa=E7on d'obtenir des r=E9ponses =E0 toutes vos questio=
ns !
> Profitez des connaissances, des opinions et des exp=E9riences des internaut=
es
> sur Yahoo! Questions/R=E9ponses
> .
--B_3245737111_78963039--
RE: RE : RE: [PHP-DB] re: small question php/postgreSQL (basic question, not small)
am 07.11.2006 19:09:53 von Dwight Altman
You have
while($row=3Dpg_fetch_array($result,NULL,PGSQL_ASSOC)) {
What's with the NULL ?
row
Row number in result to fetch. Rows are numbered from 0 upwards. If
omitted, next row is fetched.
BUT you are requesting the NULL row?
Why not just use
while($row=3Dpg_fetch_assoc($result)) {
Regards,
Dwight
> -----Original Message-----
> From: Desmond Coughlan [mailto:coughlandesmond@yahoo.fr]
> Sent: Tuesday, November 07, 2006 9:38 AM
> To: Bastien Koert; jusa_98@yahoo.com; php-db@lists.php.net
> Subject: [PHP-DB] RE : RE: [PHP-DB] re: small question php/postgreSQL
> (basic question, not small)
>=20
> X-No-Archive: true
>=20
> That doesn't work, either. Still the blank page. Hmm ... the file =
is
> in the right place../usr/local/www/data ... 'cos all of the other =
files
> (*.html one an d all) are served from there, and they're available to =
the
> outside world.
>=20
> D.
>=20
> Bastien Koert a =E9crit :
> The code does need to know what the fields are...I think a more =
likely
> issue
> is the query for some reason, also change the $query to result in the
> query
> statement
>=20
> try
>=20
> $result=3Dpg_query($query) or die(pg_error()); //to see if there are =
any
> errors with the query
>=20
> while($row=3Dpg_fetch_array($result,NULL,PGSQL_ASSOC)) {
> echo "Title: ".$row['isbn_no']."
> ";
> echo "blah ".$row['code_livre']."
> ";
> }else{
> echo "No rows found";
> }
>=20
>=20
> bastien
>=20
>=20
> >From: JeRRy
> >To: php-db@lists.php.net
> >Subject: [PHP-DB] re: small question php/postgreSQL (basic question, =
not
> >small)
> >Date: Tue, 7 Nov 2006 23:18:58 +1100 (EST)
> >
> > Date: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: "Desmond
> >Coughlan" To: "php"
>=20
> > Subject: small question php/postgreSQL
> > Hi,
> >
> > I've been trying to get a small DB up and working with PhP. It's a
> >library, and so far, I can't get past the stage of displaying a page. =
I
> >try the 'hello world' example, and it displays. I then populate a DB
> >and can access it via psql ..
> >
> > cdi=3D> 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
> >
> > OK, I then write the following script ....
> >
> > > pg_connect ("dbname=3Dcdi user=3Dcdi password=3Dtoto") or die =
("Couldn't
> >Connect: ".pg
> >_last_error());
> >$query=3D"SELECT * FROM stock";
> >$query=3Dpg_query($query);
> > // start the output
> > while($row=3Dpg_fetch_array($query,NULL,PGSQL_ASSOC)) {
> >echo "Title: ".$row['isbn_no']."
> ";
> >echo "blah ".$row['code_livre']."
> ";
> >}
> > ?>
> >
> > (sorry not to put that in italics or whatever...)
> >
> > ... and put it in the document root of my webserver, under
> >php_experimental.
> >
> > I get a blank page. The apache weblogs look like ...
> >
> > 192.168.0.254 - - [07/Nov/2006:10:37:30 +0100] "GET
> >/php_experimental/base.php HTTP/1.1" 200 - "-" "Mozilla/4.0 =
(compatible;
> >MSIE 6.0;
> >Windows NT 5.0)"
> >
> > There's something obvious that I'm missing. Any ideas ..?
> >
> >Thanks.
> >
> >D.
> >
> >------
> >
> > re:
> >
> > > pg_connect ("dbname=3Dcdi user=3Dcdi password=3Dtoto") or die =
("Couldn't
> >Connect: ".pg
> >_last_error());
> >$query=3D"SELECT * FROM stock";
> >$query=3Dpg_query($query);
> > // start the output
> > while($row=3Dpg_fetch_array($query,NULL,PGSQL_ASSOC)) {
> >echo "Title: ".$row['isbn_no']."
> ";
> >echo "blah ".$row['code_livre']."
> ";
> >}
> > ?>
> >
> > Simple, isbn_no and code_livre need to be "defined" in your code.
> >Otherwise PHP don't know what your looking for.
> >
> > There is PLENTY of docs online to show you how to display items in a =
DB.
> > Hello World is basic, too basic to use as an example and is a poor =
one
> to
> >use. If your nerw you have to go a bit more into it than Hello World
> code.
> > (which in my opinion gets you know-where) been there done that.
> >
> > Google how to display items in a DB in PHP and shoot you get some =
handy
> >things.
> >
> > I just feel this question is not required here when google has all =
the
> >answers like this.
> >
> > Jerry
>=20
> ____________________________________________________________ _____
> Ready for the world's first international mobile film festival =
celebrating
> the creative potential of today's youth? Check out Mobile Jam Fest for
> your
> a chance to WIN $10,000! www.mobilejamfest.com
>=20
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>=20
>=20
>=20
>=20
> ---------------------------------
> D=E9couvrez une nouvelle fa=E7on d'obtenir des r=E9ponses =E0 toutes =
vos
> questions ! Profitez des connaissances, des opinions et des =
exp=E9riences
> des internautes sur Yahoo! Questions/R=E9ponses.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: RE : RE: [PHP-DB] re: small question php/postgreSQL (basic question, not small)
am 08.11.2006 04:54:39 von jusa_98
--0-177076899-1162958079=:70855
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
phpinfo can be a little bit of info that may have a module missing. But I =
doubt that is the issue here, but you never know. Why don't be just change=
your query completely like you would in SQL if you were searching direct f=
or certain fields? Because if these 2 fields are the only fields you will =
EVER need in this page why be too technical. However if your thinking of a=
dding the other fields than this is trhe way to go.
I have probably mi=
ssed something along the traps. But I am happy to try and demonstrate anot=
her way you could do it.
Are you on your own server or sub-leased or s=
omething?
Jerry
=0A----- Original Message ----=0AFrom: Bastien Ko=
ert =0ATo: coughlandesmond@yahoo.fr; jusa_98@yahoo.c=
om; php-db@lists.php.net=0ASent: Wednesday, 8 November, 2006 2:45:49 AM=0AS=
ubject: RE: [PHP-DB] RE : RE: [PHP-DB] re: small question php/postgreSQL (b=
asic question, not small)
=0Ais your server set to work with php files=
?
Bastien
=0A>From: Desmond Coughlan =
=0A>To: Bastien Koert , jusa_98@yahoo.com, =0A>php-=
db@lists.php.net=0A>Subject: [PHP-DB] RE : RE: [PHP-DB] re: small question =
php/postgreSQL =0A>(basic question, not small)=0A>Date: Tue, 7 Nov 2006 16:=
38:24 +0100 (CET)=0A>=0A>X-No-Archive: true=0A>=0A> That doesn't work, ei=
ther. Still the blank page. Hmm ... the file is =0A>in the right place../=
usr/local/www/data ... 'cos all of the other files =0A>(*.html one an d all=
) are served from there, and they're available to the =0A>outside world.=0A=
>=0A> D.=0A>=0A>Bastien Koert a =E9crit :=0A> T=
he code does need to know what the fields are...I think a more likely =0A>i=
ssue=0A>is the query for some reason, also change the $query to result in t=
he query=0A>statement=0A>=0A>try=0A>=0A>$result=3Dpg_query($que ry) or die(p=
g_error()); //to see if there are any=0A>errors with the query=0A>=0A>while=
($row=3Dpg_fetch_array($result,NULL,PGSQL_ASSOC)) {=0A>echo "Title: ".$row[=
'isbn_no']."=0A>";=0A>echo "blah ".$row['code_livre']."=0A>";=0A>}else{=0A>=
echo "No rows found";=0A>}=0A>=0A>=0A>bastien=0A>=0A>=0A> >From: JeRRy=0A> =
>To: php-db@lists.php.net=0A> >Subject: [PHP-DB] re: small question php/pos=
tgreSQL (basic question, not=0A> >small)=0A> >Date: Tue, 7 Nov 2006 23:18:5=
8 +1100 (EST)=0A> >=0A> > Date: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: =
"Desmond=0A> >Coughlan" To: "php"=0A>=0A> > Subject: small question php/pos=
tgreSQL=0A> > Hi,=0A> >=0A> > I've been trying to get a small DB up and wor=
king with PhP. It's a=0A> >library, and so far, I can't get past the stage =
of displaying a page. I=0A> >try the 'hello world' example, and it displays=
.. I then populate a DB=0A> >and can access it via psql ..=0A> >=0A> > cdi=
=3D> SELECT * FROM stock ;=0A> >-[ RECORD 1 ]-+----------------------------=
---=0A> >stock_ids | 1=0A> >isbn_no | 10101010=0A> >code_livre | 23455=0A> =
>titre | toto goes to Hollywood=0A> >editeur | editions toto=0A> >collectio=
n | collection toto=0A> >auteur_nom | smith=0A> >auteur_prenom | john=0A> >=
matiere | ang=0A> >media_type | li=0A> >-[ RECORD 2 ]-+--------------------=
-----------=0A> >stock_ids | 2=0A> >isbn_no | 10536278=0A> >code_livre | 24=
874=0A> >titre | toto comes back from Hollywood=0A> >editeur | editions bab=
a=0A> >collection | collection toto=0A> >auteur_nom | martin=0A> >auteur_pr=
enom | peter=0A> >matiere | fre=0A> >media_type | dvd=0A> >=0A> > OK, I the=
n write the following script ....=0A> >=0A> > > pg_connect ("dbname=3Dcdi u=
ser=3Dcdi password=3Dtoto") or die ("Couldn't=0A> >Connect: ".pg=0A> >_last=
_error());=0A> >$query=3D"SELECT * FROM stock";=0A> >$query=3Dpg_query($que=
ry);=0A> > // start the output=0A> > while($row=3Dpg_fetch_array($query,NUL=
L,PGSQL_ASSOC)) {=0A> >echo "Title: ".$row['isbn_no']."=0A>";=0A> >echo "bl=
ah ".$row['code_livre']."=0A>";=0A> >}=0A> > ?>=0A> >=0A> > (sorry not to p=
ut that in italics or whatever...)=0A> >=0A> > ... and put it in the docume=
nt root of my webserver, under=0A> >php_experimental.=0A> >=0A> > I get a b=
lank page. The apache weblogs look like ...=0A> >=0A> > 192.168.0.254 - - [=
07/Nov/2006:10:37:30 +0100] "GET=0A> >/php_experimental/base.php HTTP/1.1" =
200 - "-" "Mozilla/4.0 (compatible;=0A> >MSIE 6.0;=0A> >Windows NT 5.0)"=0A=
> >=0A> > There's something obvious that I'm missing. Any ideas ..?=0A> >=
=0A> >Thanks.=0A> >=0A> >D.=0A> >=0A> >------=0A> >=0A> > re:=0A> >=0A> > >=
pg_connect ("dbname=3Dcdi user=3Dcdi password=3Dtoto") or die ("Couldn't=
=0A> >Connect: ".pg=0A> >_last_error());=0A> >$query=3D"SELECT * FROM stock=
";=0A> >$query=3Dpg_query($query);=0A> > // start the output=0A> > while($r=
ow=3Dpg_fetch_array($query,NULL,PGSQL_ASSOC)) {=0A> >echo "Title: ".$row['i=
sbn_no']."=0A>";=0A> >echo "blah ".$row['code_livre']."=0A>";=0A> >}=0A> > =
?>=0A> >=0A> > Simple, isbn_no and code_livre need to be "defined" in your =
code.=0A> >Otherwise PHP don't know what your looking for.=0A> >=0A> > Ther=
e is PLENTY of docs online to show you how to display items in a DB.=0A> > =
Hello World is basic, too basic to use as an example and is a poor one =0A>=
to=0A> >use. If your nerw you have to go a bit more into it than Hello Worl=
d =0A>code.=0A> > (which in my opinion gets you know-where) been there done=
that.=0A> >=0A> > Google how to display items in a DB in PHP and shoot you=
get some handy=0A> >things.=0A> >=0A> > I just feel this question is not r=
equired here when google has all the=0A> >answers like this.=0A> >=0A> > Je=
rry=0A>=0A>_________________________________________________ _______________=
_=0A>Ready for the world's first international mobile film festival celebra=
ting=0A>the creative potential of today's youth? Check out Mobile Jam Fest =
for your=0A>a chance to WIN $10,000! www.mobilejamfest.com=0A>=0A>--=0A>PHP=
Database Mailing List (http://www.php.net/)=0A>To unsubscribe, visit: http=
://www.php.net/unsub.php=0A>=0A>=0A>=0A>=0A>---------------- ---------------=
--=0A> D=E9couvrez une nouvelle fa=E7on d'obtenir des r=E9ponses =E0 toute=
s vos =0A>questions ! Profitez des connaissances, des opinions et des exp=
=E9riences des =0A>internautes sur Yahoo! Questions/R=E9ponses.
______=
___________________________________________________________= 0ANot only does=
Windows Live=99 OneCare=99 provide all-in-one PC care to keep your =0Acomp=
uter protected and well-maintained, but it also makes creating backup =0Afi=
les a breeze. Try it today! =0Ahttp://ideas.live.com/programpage.aspx?versi=
onid=3Db2456790-90e6-4d28-9219-5d7207d94d45&mkt=3Den-ca
--0-177076899-1162958079=:70855--
Re: RE : RE: [PHP-DB] re: small question php/postgreSQL (basic question, not small)
am 08.11.2006 04:58:12 von jusa_98
--0-536161113-1162958292=:53617
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Test:
- create a new account user=0A- go into the www directive=0A- cr=
eate a index file=0A- do phpinfo()=0A- try and connect to a msql server, no=
query needed just a connection=0A- under that delibrately try and enter a =
mysq server but use a wrong pass, make sure you error report it with some m=
essage on screen.
if it connects and one fails your connections are fi=
ne.
However make sure you CLOSE each connection seperatley.
What=
appears to be happening in your code it it's not going near the mysql serv=
er, it's skipping it. Which means the die error will not appear if it skip=
s it.
Ensure php is enabled and mysql is booted etc.
Also don't t=
ry and connect localhost to it, use the outside world. (a browser - www.wh=
atever.com or IP-ADDRESS)
J
=0A----- Original Message ----=0AFrom=
: Desmond Coughlan =0ATo: Bastien Koert
k@hotmail.com>; jusa_98@yahoo.com; php-db@lists.php.net=0ASent: Wednesday, =
8 November, 2006 2:38:24 AM=0ASubject: RE : RE: [PHP-DB] re: small question=
php/postgreSQL (basic question, not small)
=0AX-No-Archive: true=0A =
=0AThat doesn't work, either. Still the blank page. Hmm ... the file is i=
n the right place../usr/local/www/data ... 'cos all of the other files (*.h=
tml one an d all) are served from there, and they're available to the outsi=
de world.=0A =0AD.
Bastien Koert a =E9crit :=
=0AThe code does need to know what the fields are...I think a more likely i=
ssue =0Ais the query for some reason, also change the $query to result in t=
he query =0Astatement
try
$result=3Dpg_query($query) or die(pg_er=
ror()); //to see if there are any =0Aerrors with the query
while($row=
=3Dpg_fetch_array($result,NULL,PGSQL_ASSOC)) {=0Aecho "Title: ".$row['isbn_=
no']."=0A";=0Aecho "blah ".$row['code_livre']."=0A";=0A}else{=0Aecho "No ro=
ws found";=0A}
=0Abastien
=0A>From: JeRRy =0A>To: php-db@lists.ph=
p.net=0A>Subject: [PHP-DB] re: small question php/postgreSQL (basic questio=
n, not =0A>small)=0A>Date: Tue, 7 Nov 2006 23:18:58 +1100 (EST)=0A>=0A> Dat=
e: Tue, 7 Nov 2006 10:38:18 +0100 (CET) From: "Desmond =0A>Coughlan" To: "p=
hp" =0A> Subject: small question php/postgreSQL=0A> Hi,=0A>=0A> I've been t=
rying to get a small DB up and working with PhP. It's a=0A>library, and so =
far, I can't get past the stage of displaying a page. I=0A>try the 'hello w=
orld' example, and it displays. I then populate a DB=0A>and can access it v=
ia psql ..=0A>=0A> cdi=3D> SELECT * FROM stock ;=0A>-[ RECORD 1 ]-+--------=
-----------------------=0A>stock_ids | 1=0A>isbn_no | 10101010=0A>code_livr=
e | 23455=0A>titre | toto goes to Hollywood=0A>editeur | editions toto=0A>c=
ollection | collection toto=0A>auteur_nom | smith=0A>auteur_prenom | john=
=0A>matiere | ang=0A>media_type | li=0A>-[ RECORD 2 ]-+--------------------=
-----------=0A>stock_ids | 2=0A>isbn_no | 10536278=0A>code_livre | 24874=0A=
>titre | toto comes back from Hollywood=0A>editeur | editions baba=0A>colle=
ction | collection toto=0A>auteur_nom | martin=0A>auteur_prenom | peter=0A>=
matiere | fre=0A>media_type | dvd=0A>=0A> OK, I then write the following sc=
ript ....=0A>=0A> =0A> pg_connect ("dbname=3Dcdi user=3Dcdi password=3Dtoto=
") or die ("Couldn't=0A>Connect: ".pg=0A>_last_error());=0A>$query=3D"SELEC=
T * FROM stock";=0A>$query=3Dpg_query($query);=0A> // start the output=0A> =
while($row=3Dpg_fetch_array($query,NULL,PGSQL_ASSOC)) {=0A>echo "Title: ".$=
row['isbn_no']."=0A";=0A>echo "blah ".$row['code_livre']."=0A";=0A>}=0A> ?>=
=0A>=0A> (sorry not to put that in italics or whatever...)=0A>=0A> ... and =
put it in the document root of my webserver, under=0A>php_experimental.=0A>=
=0A> I get a blank page. The apache weblogs look like ...=0A>=0A> 192.168.0=
..254 - - [07/Nov/2006:10:37:30 +0100] "GET=0A>/php_experimental/base.php HT=
TP/1.1" 200 - "-" "Mozilla/4.0 (compatible; =0A>MSIE 6.0;=0A>Windows NT 5.0=
)"=0A>=0A> There's something obvious that I'm missing. Any ideas ..?=0A>=0A=
>Thanks.=0A>=0A>D.=0A>=0A>------=0A>=0A> re:=0A>=0A> =0A> pg_connect ("dbna=
me=3Dcdi user=3Dcdi password=3Dtoto") or die ("Couldn't=0A>Connect: ".pg=0A=
>_last_error());=0A>$query=3D"SELECT * FROM stock";=0A>$query=3Dpg_query($q=
uery);=0A> // start the output=0A> while($row=3Dpg_fetch_array($query,NULL,=
PGSQL_ASSOC)) {=0A>echo "Title: ".$row['isbn_no']."=0A";=0A>echo "blah ".$r=
ow['code_livre']."=0A";=0A>}=0A> ?>=0A>=0A> Simple, isbn_no and code_livre =
need to be "defined" in your code. =0A>Otherwise PHP don't know what your l=
ooking for.=0A>=0A> There is PLENTY of docs online to show you how to displ=
ay items in a DB. =0A> Hello World is basic, too basic to use as an example=
and is a poor one to =0A>use. If your nerw you have to go a bit more into =
it than Hello World code. =0A> (which in my opinion gets you know-where) be=
en there done that.=0A>=0A> Google how to display items in a DB in PHP and =
shoot you get some handy =0A>things.=0A>=0A> I just feel this question is n=
ot required here when google has all the =0A>answers like this.=0A>=0A> Jer=
ry
____________________________________________________ _____________=
=0AReady for the world's first international mobile film festival celebrati=
ng =0Athe creative potential of today's youth? Check out Mobile Jam Fest fo=
r your =0Aa chance to WIN $10,000! www.mobilejamfest.com
-- =0APHP Dat=
abase Mailing List (http://www.php.net/)=0ATo unsubscribe, visit: http://ww=
w.php.net/unsub.php
=0AD=E9couvrez une nouvelle fa=E7on d'=
obtenir des r=E9ponses =E0 toutes vos questions ! Profitez des connaissance=
s, des opinions et des exp=E9riences des internautes sur Yahoo! Questions/R=
=E9ponses.
--0-536161113-1162958292=:53617--
Re: Re: RE : RE: [PHP-DB] re: small question php/postgreSQL(basic question, not small)
am 08.11.2006 05:14:01 von Chris
JeRRy wrote:
> Test:
>
> - create a new account user
> - go into the www directive
> - create a index file
> - do phpinfo()
> - try and connect to a msql server, no query needed just a connection
> - under that delibrately try and enter a mysq server but use a wrong pass, make sure you error report it with some message on screen.
>
> if it connects and one fails your connections are fine.
>
> However make sure you CLOSE each connection seperatley.
>
> What appears to be happening in your code it it's not going near the mysql server, it's skipping it. Which means the die error will not appear if it skips it.
>
> Ensure php is enabled and mysql is booted etc.
>
> Also don't try and connect localhost to it, use the outside world. (a browser - www.whatever.com or IP-ADDRESS)
Err - the OP is having an issue with postgresql, not mysql. The subject
even mentions this..
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: RE : RE: [PHP-DB] re: small question php/postgreSQL (basic question, not small)
am 08.11.2006 05:20:16 von jusa_98
--0-1374957978-1162959616=:56607
Content-Type: text/plain; charset=ascii
Content-Transfer-Encoding: quoted-printable
True, sorry! (missed that, haha wake up!)
=0A----- Original Message --=
--=0AFrom: Chris =0ATo: JeRRy =0ACc: =
php-db@lists.php.net=0ASent: Wednesday, 8 November, 2006 3:14:01 PM=0ASubje=
ct: Re: [PHP-DB] Re: RE : RE: [PHP-DB] re: small question php/postgreSQL (b=
asic question, not small)
=0AJeRRy wrote:=0A> Test:=0A> =0A> - create =
a new account user=0A> - go into the www directive=0A> - create a index fil=
e=0A> - do phpinfo()=0A> - try and connect to a msql server, no query neede=
d just a connection=0A> - under that delibrately try and enter a mysq serve=
r but use a wrong pass, make sure you error report it with some message on =
screen.=0A> =0A> if it connects and one fails your connections are fine.=0A=
> =0A> However make sure you CLOSE each connection seperatley. =0A> =0A> Wh=
at appears to be happening in your code it it's not going near the mysql se=
rver, it's skipping it. Which means the die error will not appear if it sk=
ips it.=0A> =0A> Ensure php is enabled and mysql is booted etc.=0A> =0A> Al=
so don't try and connect localhost to it, use the outside world. (a browse=
r - www.whatever.com or IP-ADDRESS)
Err - the OP is having an issue wi=
th postgresql, not mysql. The subject =0Aeven mentions this..
-- =0APo=
stgresql & php tutorials=0Ahttp://www.designmagick.com/
--0-1374957978-1162959616=:56607--
Generating pages with full stories
am 13.11.2006 11:10:29 von dancemaniac
I've got a website using PHP and MySQL. I would like to make a "news
preview" on the webpage's frontpage with a link to the full story.
Is it possible to use one (1) .PHP file to generate full stories, with
MySQL involved?
I'm just a newcomer in the world of PHP but I am doing my best in reading
materials for PHP.
Thanks in advance.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Generating pages with full stories
am 13.11.2006 12:19:37 von jeffreyb
Yes...
But, the experts on this list need more info in order to help you out.
1. Where are the stories going to come from? If you plant to take news
stories from other sites and use them on your own site, there are
serious legal issues involved.
2. If you want to write the stories yourself, or invite visitors to
write your stories, then you probably want a simple content management
system using PHP and MySQL. There are a lot of them about. Google or ask
for recommendations.
3. If you'd prefer to make the site yourself in order to learn PHP +
MySQL programming, you can find lots of tutorials. Google PHP Tutorials
and look around.
Good luck,
Jeffrey
dancemaniac@edsamail.com.ph wrote:
> I've got a website using PHP and MySQL. I would like to make a "news
> preview" on the webpage's frontpage with a link to the full story.
>
> Is it possible to use one (1) .PHP file to generate full stories, with
> MySQL involved?
>
> I'm just a newcomer in the world of PHP but I am doing my best in reading
> materials for PHP.
>
> Thanks in advance.
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Generating pages with full stories
am 14.11.2006 03:18:14 von dancemaniac
I'd answer question number 3.
Well, it is just about an update section that the administrators will
input on the database for updates and event for a company, saying the
website has an updated page or simply putting an "event" for the public to
know.
Right now, I want to know how get a URL like this:
http://www.myhomepage.com/thispage.php?variable1=value_X&?va r2=val_Y
Using anchor (link) tags, not from form tags.
> Yes...
>
> But, the experts on this list need more info in order to help you out.
>
> 1. Where are the stories going to come from? If you plant to take news
> stories from other sites and use them on your own site, there are
> serious legal issues involved.
>
> 2. If you want to write the stories yourself, or invite visitors to
> write your stories, then you probably want a simple content management
> system using PHP and MySQL. There are a lot of them about. Google or ask
> for recommendations.
>
> 3. If you'd prefer to make the site yourself in order to learn PHP +
> MySQL programming, you can find lots of tutorials. Google PHP Tutorials
> and look around.
>
> Good luck,
>
> Jeffrey
>
>
> dancemaniac@edsamail.com.ph wrote:
>> I've got a website using PHP and MySQL. I would like to make a "news
>> preview" on the webpage's frontpage with a link to the full story.
>>
>> Is it possible to use one (1) .PHP file to generate full stories, with
>> MySQL involved?
>>
>> I'm just a newcomer in the world of PHP but I am doing my best in
>> reading
>> materials for PHP.
>>
>> Thanks in advance.
>>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Generating pages with full stories
am 14.11.2006 03:45:17 von J R
------=_Part_16717_31275365.1163472317655
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Here's how you should do this (IMHO):
On you front page make a sql query say you want to display the latest 3
events. Your query probably will look like this:
select event_table_id, title from event_table order by date_created desc
limit 3;
then from the result make a while or for loop (for example your result is
stored in an array $aResult)
foreach ($aResult as $value) {
echo '
href="eventFullStories.php?eventId='.$value['event_table_id' ].'">'.$value['title'].';
}
Then on your eventFullSyories.php just query the event_table for that
eventId and display the event full story.
hth,
john
On 11/14/06, dancemaniac@edsamail.com.ph
wrote:
>
> I'd answer question number 3.
>
> Well, it is just about an update section that the administrators will
> input on the database for updates and event for a company, saying the
> website has an updated page or simply putting an "event" for the public to
> know.
>
> Right now, I want to know how get a URL like this:
>
> http://www.myhomepage.com/thispage.php?variable1=value_X&?va r2=val_Y
>
> Using anchor (link) tags, not from form tags.
>
> > Yes...
> >
> > But, the experts on this list need more info in order to help you out.
> >
> > 1. Where are the stories going to come from? If you plant to take news
> > stories from other sites and use them on your own site, there are
> > serious legal issues involved.
> >
> > 2. If you want to write the stories yourself, or invite visitors to
> > write your stories, then you probably want a simple content management
> > system using PHP and MySQL. There are a lot of them about. Google or ask
> > for recommendations.
> >
> > 3. If you'd prefer to make the site yourself in order to learn PHP +
> > MySQL programming, you can find lots of tutorials. Google PHP Tutorials
> > and look around.
> >
> > Good luck,
> >
> > Jeffrey
> >
> >
> > dancemaniac@edsamail.com.ph wrote:
> >> I've got a website using PHP and MySQL. I would like to make a "news
> >> preview" on the webpage's frontpage with a link to the full story.
> >>
> >> Is it possible to use one (1) .PHP file to generate full stories, with
> >> MySQL involved?
> >>
> >> I'm just a newcomer in the world of PHP but I am doing my best in
> >> reading
> >> materials for PHP.
> >>
> >> Thanks in advance.
> >>
> >
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
GMail Rocks!!!
------=_Part_16717_31275365.1163472317655--