Re: Update problem - Mailing list pgsql-php

From Ângelo Marcos Rigo
Subject Re: Update problem
Date
Msg-id 20030821134321.2549.qmail@web14811.mail.yahoo.com
Whole thread Raw
In response to Re: Update problem  (Gerd Terlutter <gerd@MplusB.de>)
List 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@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

pgsql-php by date:

Previous
From: Gerd Terlutter
Date:
Subject: Re: Update problem
Next
From: "Dave [Hawk-Systems]"
Date:
Subject: select to detect overlapping timeframes