Re: Update script

Поиск
Список
Период
Сортировка
От CoL
Тема Re: Update script
Дата
Msg-id bhh5fj$1jua$1@news.hub.org
обсуждение исходный текст
Ответ на Update script  (Ângelo Marcos Rigo <angelo_rigo@yahoo.com.br>)
Ответы Re: Update script
Список pgsql-php
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.


В списке pgsql-php по дате отправления:

Предыдущее
От: "David Busby"
Дата:
Сообщение: Re: Update script
Следующее
От: Ângelo Marcos Rigo
Дата:
Сообщение: Re: Update script