pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedLooking for help
5+ messages / 5 participants
[nested] [flat]
* Looking for help
@ 2002-08-27 22:56 Joseph L Montes <jmontes@zenplex.com>
0 siblings, 2 replies; 5+ messages in thread
From: Joseph L Montes @ 2002-08-27 22:56 UTC (permalink / raw)
To: pgsql-php
I am new to combining PHP and Postgres. I am able to Select and create
tables by using the Select * From "table" command fine, but What happens
if I only want to select a couple of fields. How do I go about this.
also how do you select from a table that is not all lower case. Granted
this is probably quite simple, but I am new to this. thanks ewveryone
--
Joseph L Montes
Senior Systems Engineer
Zenplex Inc.
317 Madison Ave. suite 1500
New York New York
V(212)499-0668 Ext. 203
F(646)865-0783
http://www.zenplex.com
http://www.zenplex.org
http://www.tambora.org
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Looking for help
@ 2002-08-27 23:05 Patrick Hatcher <PHatcher@macys.com>
0 siblings, 1 reply; 5+ messages in thread
From: Patrick Hatcher @ 2002-08-27 23:05 UTC (permalink / raw)
To: "Joseph L Montes <jmontes" <jmontes@zenplex.com>; +Cc: pgsql-php; pgsql-php-owner@postgresql.org
Use quotes around the field and table names that are not all lower case:
Ex:
$result = pg_query($db," Select 'Field1',field2, 'fEild3' From'TABLE1' ");
Patrick Hatcher
Joseph L Montes
<jmontes@zenplex.com To: pgsql-php@postgresql.org
> cc:
Sent by: Subject: [PHP] Looking for help
pgsql-php-owner@post
gresql.org
08/27/2002 03:56 PM
I am new to combining PHP and Postgres. I am able to Select and create
tables by using the Select * From "table" command fine, but What happens
if I only want to select a couple of fields. How do I go about this.
also how do you select from a table that is not all lower case. Granted
this is probably quite simple, but I am new to this. thanks ewveryone
--
Joseph L Montes
Senior Systems Engineer
Zenplex Inc.
317 Madison Ave. suite 1500
New York New York
V(212)499-0668 Ext. 203
F(646)865-0783
http://www.zenplex.com
http://www.zenplex.org
http://www.tambora.org
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Looking for help
@ 2002-08-27 23:20 Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
parent: Joseph L Montes <jmontes@zenplex.com>
1 sibling, 0 replies; 5+ messages in thread
From: Cornelia Boenigk @ 2002-08-27 23:20 UTC (permalink / raw)
To: Joseph L Montes <jmontes@zenplex.com>; pgsql-php
Hi Joseph
> but What happens
> if I only want to select a couple of fields.
Then you tell the server which fields you want to select;-)
SELECT field1, field2, ... , fieldn FROM table ...
> how do you select from a table that is not all lower case
what do you mean? what is not all lower case?
PostgreSQL returns the contents of the fields as they are. If you need
the results to be in lower case use
SELECT lower(fieldx), lower(field2),... FROM table
respectively
SELECT upper(field1), upper(field2), ... FROM table.
See chapter 4.4 of the PostgreSQL user's Guide for more.
The PHP-Functions to change case are strtoupper() and strtolower().
Hope it helps
Regards
Conni
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Looking for help
@ 2002-08-28 00:06 Papp Gyozo <pgerzson@freestart.hu>
parent: Patrick Hatcher <PHatcher@macys.com>
0 siblings, 0 replies; 5+ messages in thread
From: Papp Gyozo @ 2002-08-28 00:06 UTC (permalink / raw)
To: Patrick Hatcher <PHatcher@macys.com>; Joseph L Montes <jmontes@zenplex.com>; +Cc: pgsql-php
2002. augusztus 28. 01:05 dátummal Patrick Hatcher ezt írta:
> Use quotes around the field and table names that are not all lower
> case:
>
> Ex:
> $result = pg_query($db," Select 'Field1',field2, 'fEild3'
> From'TABLE1' ");
>
AFAIK, opstgres needs double quotes to handle objects' names literally
-- as written:
$result = pg_query($db,' Select "Field1",field2, "fiEld3"
From "TABLE1"');
text within simple quotes represents string literals.
--
Papp, Győző
- pgerzson@freestart.hu
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Looking for help
@ 2002-08-28 01:38 Keary Suska <hierophant@pcisys.net>
parent: Joseph L Montes <jmontes@zenplex.com>
1 sibling, 0 replies; 5+ messages in thread
From: Keary Suska @ 2002-08-28 01:38 UTC (permalink / raw)
To: pgsql-php
on 8/27/02 4:56 PM, jmontes@zenplex.com purportedly said:
> also how do you select from a table that is not all lower case. Granted
> this is probably quite simple, but I am new to this. thanks ewveryone
Table and column names are not case-sensitive in Postgres.
Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2002-08-28 01:38 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-08-27 22:56 Looking for help Joseph L Montes <jmontes@zenplex.com>
2002-08-27 23:20 ` Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
2002-08-28 01:38 ` Keary Suska <hierophant@pcisys.net>
2002-08-27 23:05 Re: Looking for help Patrick Hatcher <PHatcher@macys.com>
2002-08-28 00:06 ` Papp Gyozo <pgerzson@freestart.hu>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox