Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: shreedhar <shreedhar(at)lucidindia(dot)net>
Cc: Postgre General <pgsql-general(at)postgresql(dot)org>, Postgre Admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length
Date: 2003-09-23 11:30:58
Message-ID: Pine.LNX.4.21.0309231227300.22150-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

On Tue, 23 Sep 2003, shreedhar wrote:

> If I try to delete a record from my table which is giving following error
>
>
> Warning: PostgreSQL query failed: ERROR: pg_atoi: zero-length string in
> /xxx/database.inc on line 73
>
> What might be the problem.

Looks like line 73 of your /xxx/database.inc PHP script is submitting a query
formated with a zero length string instead of a number. Look for the variable
being formated into the query string being undefined thereby leading to the
somethat that looks like:

delete from aaa where id =

instead of a more normal:

delete from aaa where id = 44

You wouldn't believe the number of times I've explained that error message to a
PHP developer.

--
Nigel J. Andrews

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Joshua D. Drake 2003-09-23 14:52:02 Re: [GENERAL] PostgreSQL query failed: ERROR: pg_atoi: zero-length
Previous Message Holger Jakobs 2003-09-23 11:23:37 pg_hba.conf improvements

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2003-09-23 13:51:26 Re: after postgres upgrade - ERROR: current transaction
Previous Message rolf.ostvik 2003-09-23 11:26:19 Re: DSN-Less