Re: Update script

From: Ângelo Marcos Rigo <angelo_rigo(at)yahoo(dot)com(dot)br>
To: col(at)mportal(dot)hu
Cc: pgsql-php(at)postgresql(dot)org
Subject: Re: Update script
Date: 2003-08-15 10:53:52
Message-ID: 20030815105352.63670.qmail@web14802.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hi Col

Thank´s for the postgre version note
my problem was that i just forget the name=id atribute
in the textfield

Best regards

--- CoL <col(at)mportal(dot)hu> escreveu: > Hi,
>
>
> Ângelo Marcos Rigo wrote, On 8/14/2003 3:46 PM:
> > Hi
> >
> > I have a script to update some records in a
> postgresql
> > database. when i do modify what i have to modify
> it
> > give me the warning:
> >
> > Warning: pg_query() query failed: ERROR: pg_atoi:
> > zero-length string in
> > /var/www/html/adm/modificar_2.php on line 24
> > ERROR
> >
> > this is line 24:
> > $result = pg_query($db, $query);
> >
> > this is modificar_2.php :
> >
> > <?php
> > $id = $_POST['id'];
> > $titulo = $_POST['titulo'];
> > $texto = $_POST['texto'];
> >
> > include 'db.php';
> > $query = "UPDATE table SET titulo='$titulo',
> > texto='$texto' WHERE id='$id'";
> print $query; You will get:
> UPDATE table SET titulo='somthing',texto='text'
> WHERE id=''
>
> And your pg version is >= 7.2, where you can not
> insert '' string in
> integer type. cast $id as integer, '".($id+0)."' or
> intval or others.
>
> C.
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

=====
Ângelo Marcos Rigo
AMR Informática
(51) 3348 0870
Rua Pe. Alois Kades 400/210
Porto Alegre /RS/Brasil
http://amr.freezope.org
angelo_rigo(at)yahoo(dot)com(dot)br

_______________________________________________________________________
Conheça o novo Cadê? - Mais rápido, mais fácil e mais preciso.
Toda a web, 42 milhões de páginas brasileiras e nova busca por imagens!
http://www.cade.com.br

In response to

Browse pgsql-php by date

  From Date Subject
Next Message DeJuan Jackson 2003-08-15 18:15:57 PHP and COPY
Previous Message CoL 2003-08-14 23:22:32 Re: Update script