pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_query undefined?
6+ messages / 5 participants
[nested] [flat]
* pg_query undefined?
@ 2003-07-12 22:54 Lynna Landstreet <lynna@gallery44.org>
0 siblings, 3 replies; 6+ messages in thread
From: Lynna Landstreet @ 2003-07-12 22:54 UTC (permalink / raw)
To: pgsql-php
Does anyone know why trying to run a simple demo script (the one that came
with EZ_SQL from php.justinvincent.com) would be giving me an error saying
that pg_query() is an undefined function? It's a standard function built
into PHP, isn't it? It's listed in the manual...
I know the installation of PHP at our web host does have PostgreSQL support,
because when I ran phpinfo() it seemed to say all the right things about it,
so this is really confusing me.
Lynna
--
Resource Centre Database Coordinator
Gallery 44
www.gallery44.org
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pg_query undefined?
@ 2003-07-12 23:15 Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
parent: Lynna Landstreet <lynna@gallery44.org>
2 siblings, 1 reply; 6+ messages in thread
From: Cornelia Boenigk @ 2003-07-12 23:15 UTC (permalink / raw)
To: Lynna Landstreet <lynna@gallery44.org>; pgsql-php
Hi Lynna
> because when I ran phpinfo()
If you run phpinfo() you can see the PHP version.
pg_query() is supported since PHP 4.2.0
If your PHP is older than this use pg_exec() instead.
Greetings
Conni
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pg_query undefined?
@ 2003-07-12 23:15 Joe Conway <mail@joeconway.com>
parent: Lynna Landstreet <lynna@gallery44.org>
2 siblings, 0 replies; 6+ messages in thread
From: Joe Conway @ 2003-07-12 23:15 UTC (permalink / raw)
To: Lynna Landstreet <lynna@gallery44.org>; +Cc: pgsql-php
Lynna Landstreet wrote:
> Does anyone know why trying to run a simple demo script (the one that came
> with EZ_SQL from php.justinvincent.com) would be giving me an error saying
> that pg_query() is an undefined function? It's a standard function built
> into PHP, isn't it? It's listed in the manual...
>
> I know the installation of PHP at our web host does have PostgreSQL support,
> because when I ran phpinfo() it seemed to say all the right things about it,
> so this is really confusing me.
pg_query was new in PHP 4.2:
http://us3.php.net/manual/en/function.pg-query.php
"pg_query
(PHP 4 >= 4.2.0)
Note: This function used to be called pg_exec(). pg_exec() is still
available for compatibility reasons but users are encouraged to use
the newer name."
What version does phpinfo say your host is running?
Joe
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pg_query undefined?
@ 2003-07-13 06:00 Ray Hunter <rhunter@venticon.com>
parent: Lynna Landstreet <lynna@gallery44.org>
2 siblings, 1 reply; 6+ messages in thread
From: Ray Hunter @ 2003-07-13 06:00 UTC (permalink / raw)
To: pgsql-php
Also make sure that pgsql is installed in php. By checking the phpinfo()
function u can verify your php version (4.2+) and if pgsql has been
compiled into php.
If you have 4.2 or higher than u might need to compile pgsql into php.
--
Ray
On Sat, 2003-07-12 at 16:54, Lynna Landstreet wrote:
> Does anyone know why trying to run a simple demo script (the one that came
> with EZ_SQL from php.justinvincent.com) would be giving me an error saying
> that pg_query() is an undefined function? It's a standard function built
> into PHP, isn't it? It's listed in the manual...
>
> I know the installation of PHP at our web host does have PostgreSQL support,
> because when I ran phpinfo() it seemed to say all the right things about it,
> so this is really confusing me.
>
>
> Lynna
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pg_query undefined?
@ 2003-07-13 13:59 Gerd Terlutter <gerd@MplusB.de>
parent: Ray Hunter <rhunter@venticon.com>
0 siblings, 0 replies; 6+ messages in thread
From: Gerd Terlutter @ 2003-07-13 13:59 UTC (permalink / raw)
To: pgsql-php; +Cc: rhunter@venticon.com
Hi all,
best to use for simple statements is PEAR::DB. you can write code
abstract. i found this out while convert a DB from mysql to pgsql, now
we'll wrap table and field names. then we are always sureto write
universal code. the problem was the following:
mysql table and field names are sometimes uppercase
while converting with my2pg.pl all names changed to lowercase
alterante: quote tables and fields, but then quote it in your code to.
if you try to run this quoted code on mysql you'll get errors.
when we have all wrapped, i hope it will run under several RDBMS.
excuse my bad english, it's to long ago i learned it and not often spoken.
have fun, Gerd
Ray Hunter wrote:
> Also make sure that pgsql is installed in php. By checking the phpinfo()
> function u can verify your php version (4.2+) and if pgsql has been
> compiled into php.
>
> If you have 4.2 or higher than u might need to compile pgsql into php.
>
> --
> Ray
>
> On Sat, 2003-07-12 at 16:54, Lynna Landstreet wrote:
>
>>Does anyone know why trying to run a simple demo script (the one that came
>>with EZ_SQL from php.justinvincent.com) would be giving me an error saying
>>that pg_query() is an undefined function? It's a standard function built
>>into PHP, isn't it? It's listed in the manual...
>>
>>I know the installation of PHP at our web host does have PostgreSQL support,
>>because when I ran phpinfo() it seemed to say all the right things about it,
>>so this is really confusing me.
>>
>>
>>Lynna
--
--------------------------------------------------------
# Gerd Terlutter | Mueller+Blanck Software GmbH #
# gerd@MplusB.de | Gutenbergring 38 #
# gerd.terlutter@web.de | D-22848 Noderstedt #
# tel:0171/6992579 | tel:+49 40 500 171-1 #
# Buero:040/500171-17 | fax:+49 40 500 171-71 #
--------------------------------------------------------
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pg_query undefined?
@ 2003-07-15 19:38 Lynna Landstreet <lynna@gallery44.org>
parent: Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
0 siblings, 0 replies; 6+ messages in thread
From: Lynna Landstreet @ 2003-07-15 19:38 UTC (permalink / raw)
To: Cornelia Boenigk <poppcorn@cornelia-boenigk.de>; pgsql-php
on 7/12/03 7:15 PM, Cornelia Boenigk at poppcorn@cornelia-boenigk.de wrote:
> If you run phpinfo() you can see the PHP version.
>
> pg_query() is supported since PHP 4.2.0
>
> If your PHP is older than this use pg_exec() instead.
Aha - that would be it! Thank you! I just checked phpinfo and it says it's
4.1.2.
I can do a global find and replace to turn all instances of pg_query into
pg_exec in the ez_sql script I downloaded, but now I wonder if there will be
other functions that have changed between versions as well. Guess the only
way to find out is to try.
*sigh* Yet another reason to loathe and despise the web host I'm stuck with
here. I could ask them to upgrade their PHP installation, but given that
they never answered my request to upgrade PostgreSQL a month ago (they're
still running 7.2), or my *four* requests (well, the same request sent four
times) for a working cgi-bin directory, or about 75% of any other tech
support requests I've sent them, I'm not holding out too much hope for this
one.
Can anyone recommend a *good* web host that supports PHP and PostgreSQL? One
that's affordable enough for a small non-profit art gallery?
Thanks,
Lynna
--
Resource Centre Database Coordinator
Gallery 44
www.gallery44.org
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2003-07-15 19:38 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-07-12 22:54 pg_query undefined? Lynna Landstreet <lynna@gallery44.org>
2003-07-12 23:15 ` Cornelia Boenigk <poppcorn@cornelia-boenigk.de>
2003-07-15 19:38 ` Lynna Landstreet <lynna@gallery44.org>
2003-07-12 23:15 ` Joe Conway <mail@joeconway.com>
2003-07-13 06:00 ` Ray Hunter <rhunter@venticon.com>
2003-07-13 13:59 ` Gerd Terlutter <gerd@MplusB.de>
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