Re: Update problem

From: Ângelo Marcos Rigo <angelo_rigo(at)yahoo(dot)com(dot)br>
To: Gerd Terlutter <gerd(at)MplusB(dot)de>
Cc: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, pgsql-php(at)postgresql(dot)org
Subject: Re: Update problem
Date: 2003-08-21 13:43:21
Message-ID: 20030821134321.2549.qmail@web14811.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Thank´s the pg_escape_string works, i still turn the
wrap atributte from the textarea to virtual

But at the update part of the scripts doing a print
query return me:

UPDATE revista SET titulo='ASILO PADRE CACIQUE ',
resumo='Sociedade Humanitária Padre Cacique fundada em
12 de maio de 1982, entidade particular com fins
beneficentes.', texto='' WHERE id='16'Estes valores
foram atualizados:

The texto (or text) field still is passed by empty

here is the update_2.php (there is update.php and
update_1.php)

<?php

$id = $_POST['id'];
$titulo = pg_escape_string($_POST['titulo']);
$resumo = pg_escape_string($_POST['resumo']);
$texto = pg_escape_string($_POST['texto']);
var_dump($texto);
print("<p>");
print_r($texto);
print("<p>");
include 'db.php';
$query = "UPDATE table SET titulo='$titulo',
resumo='$resumo', texto='$texto' WHERE id='$id'";
print $query;
$result = pg_query($db, $query);
if (!$result) {printf ("ERROR"); exit;}
print ("Estes valores foram atualizados:<P> -
$id<BR>- $titulo<BR>- $resumo<BR>- $texto<BR>");
pg_close($db);

?>

--- Gerd Terlutter <gerd(at)MplusB(dot)de> escreveu: >
pg_scape_string() ?
> better
> pg_escape_string() ?
> Ângelo Marcos Rigo wrote:
> > Hi !!
> >
> > I do this:
> >
> > $titulo = pg_scape_string($_POST['titulo']);
> > $resumo = pg_scape_string($_POST['resumo']);
> > $texto = pg_scape_string($_POST['texto']);
> >
> > but it do not work is it correct?
> >>>do a clean up with:
> >>>$texto = pg_scape_string($_POST['texto']);
> >>Not sure, I'm just guessing. Anytime you want to
> >>put text into the
> >>database you need to pg_escape_string($field) each
>
>
> --
>
--------------------------------------------------------
> # Gerd Terlutter | Mueller+Blanck Software
> GmbH #
> # gerd(at)MplusB(dot)de | Gutenbergring 38
> #
> # gerd(dot)terlutter(at)web(dot)de | D-22848 Noderstedt
> #
> # tel:0171/6992579 | tel:+49 40 500 171-1
> #
> # Buero:040/500171-17 | fax:+49 40 500 171-71
> #
>
--------------------------------------------------------
>
>

=====
Â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

_______________________________________________________________________
Desafio AntiZona - Um emocionante desafio de perguntas e respostas que
te dá um Renault Clio, kits de eletrônicos, computadores, notebooks e
mochilas. Cadastre-se, participe e concorra!
www.cade.com.br/antizona

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Dave [Hawk-Systems] 2003-08-21 15:09:55 select to detect overlapping timeframes
Previous Message Gerd Terlutter 2003-08-21 12:28:21 Re: Update problem