Обсуждение: Very queer errors with Postgres/PHP

Поиск
Список
Период
Сортировка

Very queer errors with Postgres/PHP

От
Jeff MacDonald
Дата:
Hi Folks,

I'm running PostgreSQL 7.0.2 and PHP 4.0.2 on FreeBSD
4.1.1 Stable (intel)

I'd debugging an application for a client and here's an example
of a repetitive error he's been reporting..

-------------------
Warning: PostgreSQL query failed: ERROR: Attribute 't' not found in
/home/vhosts/mmfreedomclub.com/php-global/conf.php on line 25

Warning: Supplied argument is not a valid PostgreSQL result resource in
/home/vhosts/mmfreedomclub.com/php-global/conf.php on line 26

Warning: PostgreSQL query failed: ERROR: Attribute 't' not found in
/home/vhosts/mmfreedomclub.com/php-global/conf.php on line 52

Warning: Supplied argument is not a valid PostgreSQL result resource in
/home/vhosts/mmfreedomclub.com/php-global/conf.php on line 53
------------------

but.. here's the said lines in each file..

line 25
$select = pg_exec($dbh,"SELECT password FROM members WHERE member_id = $user");

line 26
if (pg_numrows($select) == 0) { return 0; }

line 52
$cp = pg_exec($dbh,"SELECT payed FROM members WHERE member_id = $mid");

line 53
if (pg_result($cp,0,0) == 'f') {

-------------------

Weird eh ?

Jeff MacDonald,

-----------------------------------------------------
PostgreSQL Inc        | Hub.Org Networking Services
jeff@pgsql.com        | jeff@hub.org
www.pgsql.com        | www.hub.org
1-902-542-0713        | 1-902-542-3657
-----------------------------------------------------
Facsimile : 1 902 542 5386
IRC Nick  : bignose


Re: Very queer errors with Postgres/PHP

От
Tom Lane
Дата:
Jeff MacDonald <jeff@hub.org> writes:
> Warning: PostgreSQL query failed: ERROR: Attribute 't' not found in
> /home/vhosts/mmfreedomclub.com/php-global/conf.php on line 25

> line 25
> $select = pg_exec($dbh,"SELECT password FROM members WHERE member_id = $user");

Hm.  What does $user contain?  If it's just "t" (no quotes) that'd
provoke this error message.

            regards, tom lane

Re: Very queer errors with Postgres/PHP

От
Jeff MacDonald
Дата:
i actually figured this out.. it was a byproduct of some
othere errors the client negelected to tell me he was experiencing :)

jeff

On Thu, 23 Nov 2000, Tom Lane wrote:

> Jeff MacDonald <jeff@hub.org> writes:
> > Warning: PostgreSQL query failed: ERROR: Attribute 't' not found in
> > /home/vhosts/mmfreedomclub.com/php-global/conf.php on line 25
>
> > line 25
> > $select = pg_exec($dbh,"SELECT password FROM members WHERE member_id = $user");
>
> Hm.  What does $user contain?  If it's just "t" (no quotes) that'd
> provoke this error message.
>
>             regards, tom lane
>

Jeff MacDonald,

-----------------------------------------------------
PostgreSQL Inc        | Hub.Org Networking Services
jeff@pgsql.com        | jeff@hub.org
www.pgsql.com        | www.hub.org
1-902-542-0713        | 1-902-542-3657
-----------------------------------------------------
Facsimile : 1 902 542 5386
IRC Nick  : bignose