pg_query undefined?
am 13.07.2003 00:54:12 von Lynna Landstreet
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
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
Re: pg_query undefined?
am 13.07.2003 01:15:11 von Cornelia Boenigk
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
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Re: pg_query undefined?
am 13.07.2003 01:15:36 von Joe Conway
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
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
Re: pg_query undefined?
am 13.07.2003 08:00:12 von Ray Hunter
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
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Re: pg_query undefined?
am 13.07.2003 15:59:36 von Gerd Terlutter
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 #
--------------------------------------------------------
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Re: pg_query undefined?
am 15.07.2003 21:38:42 von Lynna Landstreet
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
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
phpPgAdmin 2.4.2
am 16.07.2003 10:47:57 von Salah Abdulla
This is a multi-part message in MIME format.
------=_NextPart_000_015B_01C34BBA.02BCBE30
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Installed postgreql 7.3.3 and phpPgAdmin 2.4.2 in different machines. Defin=
ed password for postgres superuser. Entry is created in the pg_shadow table=
for the same user. Keeping the access method in pg_hba.conf file as "trust=
", I do not have any problem. However when changed the access method to "pa=
ssword" and tried managing the database using the phpPgAdmin tool I get=20
Error - /var/www/pgadmin.intranet/htdocs/lib.inc.php -- Line: 303=20
PostgreSQL said:=20
Your query:=20
Unable to connect with settings: host=3Dhost_name' port=3D'post_num' dbname=
=3D'template1' user=3D'user_id' password=3D'xxxxx'=20
The pg_hpa.conf file has an entry
"host all all ip_address ip_mask password"
Any idea why this is happening.
Regards,
Salah
------=_NextPart_000_015B_01C34BBA.02BCBE30
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Installed postgreql 7.3.3 and phpPgAdmin 2=
..4.2 in=20
different machines. Defined password for postgres superuser. Entry is creat=
ed in=20
the pg_shadow table for the same user. Keeping the access method in pg_hba.=
conf=20
file as "trust", I do not have any problem. However when changed the access=
=20
method to "password" and tried managing the database using the phpPgA=
dmin=20
tool I get
Error -=20
/var/www/pgadmin.intranet/htdocs/lib.inc.php -- Line: 303
PostgreSQL said:
Your query:
Unabl=
e to=20
connect with settings: host=3Dhost_name' port=3D'post_num' dbname=3D'templa=
te1'=20
user=3D'user_id' password=3D'xxxxx'
The pg_hpa.conf file has an entry=
DIV>
"host =20
all =20
all ip_address =
=20
ip_mask password"
Any idea why this is happening.
V>
Regards,
Salah
------=_NextPart_000_015B_01C34BBA.02BCBE30--
Re: phpPgAdmin 2.4.2
am 16.07.2003 22:07:39 von Robert Treat
2.4.2 doesn't support 7.3, go get phppgadmin 3.0.
Thats not your problem, but you're not going to get too far until you
switch to 3.0. Check your postgresql log for a FATAL message when you
try and connect, it should give a little better explanation of what went
wrong.
Robert Treat
On Wed, 2003-07-16 at 04:47, Salah Abdulla wrote:
> Installed postgreql 7.3.3 and phpPgAdmin 2.4.2 in different machines.
> Defined password for postgres superuser. Entry is created in the
> pg_shadow table for the same user. Keeping the access method in
> pg_hba.conf file as "trust", I do not have any problem. However when
> changed the access method to "password" and tried managing the database
> using the phpPgAdmin tool I get
>
> Error - /var/www/pgadmin.intranet/htdocs/lib.inc.php -- Line: 303
> PostgreSQL said:
> Your query:
> Unable to connect with settings: host=host_name' port='post_num'
> dbname='template1' user='user_id' password='xxxxx'
>
> The pg_hpa.conf file has an entry
> "host all all ip_address ip_mask password"
>
> Any idea why this is happening.
>
> Regards,
> Salah
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Re: phpPgAdmin 2.4.2
am 21.07.2003 05:25:49 von Christopher Kings-Lynne
This is a multi-part message in MIME format.
------=_NextPart_000_0579_01C34F7A.D5EED770
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Don't use phpPgAdmin 2.4.2 with Postgres 7.3.x - you should be using phpPgA=
dmin 3.0
Chris
----- Original Message -----=20
From: Salah Abdulla=20
To: pgsql-php@postgresql.org=20
Sent: Wednesday, July 16, 2003 4:47 PM
Subject: [PHP] phpPgAdmin 2.4.2
Installed postgreql 7.3.3 and phpPgAdmin 2.4.2 in different machines. Def=
ined password for postgres superuser. Entry is created in the pg_shadow tab=
le for the same user. Keeping the access method in pg_hba.conf file as "tru=
st", I do not have any problem. However when changed the access method to "=
password" and tried managing the database using the phpPgAdmin tool I get=
=20
Error - /var/www/pgadmin.intranet/htdocs/lib.inc.php -- Line: 303=20
PostgreSQL said:=20
Your query:=20
Unable to connect with settings: host=3Dhost_name' port=3D'post_num' dbna=
me=3D'template1' user=3D'user_id' password=3D'xxxxx'=20
The pg_hpa.conf file has an entry
"host all all ip_address ip_mask password"
Any idea why this is happening.
Regards,
Salah
------=_NextPart_000_0579_01C34F7A.D5EED770
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Don't use phpPgAdmin 2.4.2 with Postgres 7.3.x - you sh=
ould be=20
using phpPgAdmin 3.0
Chris
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LE=
FT: #000000 2px solid; MARGIN-RIGHT: 0px">
----- Original Message -----
style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black">Fro=
m:=20
Salah=
=20
Abdulla
To:
l.org=20
href=3D"mailto:pgsql-php@postgresql.org">pgsql-php@postgresq l.org
IV>
Sent: Wednesday, July 16, 2003 4:4=
7=20
PM
Subject: [PHP] phpPgAdmin 2.4.2
IV>
Installed postgreql 7.3.3 and phpPgAdmin=
2.4.2 in=20
different machines. Defined password for postgres superuser. Entry is cre=
ated=20
in the pg_shadow table for the same user. Keeping the access method in=20
pg_hba.conf file as "trust", I do not have any problem. However when chan=
ged=20
the access method to "password" and tried managing the database usi=
ng=20
the phpPgAdmin tool I get
Error -=20
/var/www/pgadmin.intranet/htdocs/lib.inc.php -- Line: 303
PostgreSQL said:
Your query:
Una=
ble to=20
connect with settings: host=3Dhost_name' port=3D'post_num' dbname=3D'temp=
late1'=20
user=3D'user_id' password=3D'xxxxx'
The pg_hpa.conf file has an entry=
"host =20
all =20
all ip_address =
=20
ip_mask password"
Any idea why this is happening.=
DIV>
Regards,
Salah
=
HTML>
------=_NextPart_000_0579_01C34F7A.D5EED770--