From: Ângelo Marcos Rigo <angelo_rigo@yahoo.com.br>
To: Gerd Terlutter <gerd@MplusB.de>
Cc: scott.marlowe <scott.marlowe@ihs.com>
Cc: pgsql-php@postgresql.org
Subject: Re: Update problem
Date: Thu, 21 Aug 2003 10:43:21 -0300 (ART)
Message-ID: <20030821134321.2549.qmail@web14811.mail.yahoo.com> (raw)
In-Reply-To: <3F44BAE5.1080605@MplusB.de>
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@MplusB.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@MplusB.de | Gutenbergring 38
> #
> # gerd.terlutter@web.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@yahoo.com.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: angelo_rigo@yahoo.com.br, gerd@MplusB.de, scott.marlowe@ihs.com
Subject: Re: Update problem
In-Reply-To: <20030821134321.2549.qmail@web14811.mail.yahoo.com>
References: <3F44BAE5.1080605@MplusB.de> <20030821134321.2549.qmail@web14811.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox