Update problem
am 19.08.2003 16:21:07 von angelo_rigo
I have an update escript that works fine with text
fields but with an textarea version the script is
passing an empty value, for the "texto" field=20
Here is a snip of code that receives the values:
$id =3D $_POST['id'];
$titulo =3D $_POST['titulo'];
$resumo =3D $_POST['resumo'];
$texto =3D $_POST['texto'];
print_r($texto);
include 'db.php';=20
$query =3D "UPDATE revista SET titulo=3D'$titulo',
resumo=3D'$resumo', texto=3D'$texto' WHERE id=3D'$id'";
here is the "texto" field where i do write the
modifications to be updated:
print ("
Texto |
rows=3D\"20\" value=3D\"$myrow[3]\"
name=3D\"texto\">$myrow[3] |
");
Thank=B4s in advance=20
=====3D
=C2ngelo Marcos Rigo
AMR Inform=E1tica=20
(51) 3348 0870=20
Rua Pe. Alois Kades 400/210=20
Porto Alegre /RS/Brasil
http://amr.freezope.org
angelo_rigo@yahoo.com.br
=20
____________________________________________________________ ___________
Desafio AntiZona - Um emocionante desafio de perguntas e respostas que
te d=E1 um Renault Clio, kits de eletr=F4nicos, computadores, notebooks e=
=20
mochilas. Cadastre-se, participe e concorra!
www.cade.com.br/antizona
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Re: Update problem
am 19.08.2003 16:44:37 von angelo_rigo
and i dont know why but if the "texto" field (wich is
a text data type on postgres) is empty and i write
something the update happen with success.
--- =C2ngelo Marcos Rigo
escreveu: > I have an update escript that works fine
with text
> fields but with an textarea version the script is
> passing an empty value, for the "texto" field=20
> Here is a snip of code that receives the values:
>=20
> $id =3D $_POST['id'];
> $titulo =3D $_POST['titulo'];
> $resumo =3D $_POST['resumo'];
> $texto =3D $_POST['texto'];
> print_r($texto);
> include 'db.php';=20
> $query =3D "UPDATE revista SET titulo=3D'$titulo',
> resumo=3D'$resumo', texto=3D'$texto' WHERE id=3D'$id'";
>=20
> here is the "texto" field where i do write the
> modifications to be updated:
>=20
> print ("Texto |
> rows=3D\"20\" value=3D\"$myrow[3]\"
> name=3D\"texto\">$myrow[3] |
");
>=20
> Thank=B4s in advance=20
>=20
> =====3D
> =C2ngelo Marcos Rigo
> AMR Inform=E1tica=20
> (51) 3348 0870=20
> Rua Pe. Alois Kades 400/210=20
> Porto Alegre /RS/Brasil
> http://amr.freezope.org
> angelo_rigo@yahoo.com.br
> =20
>=20
>=20
>
____________________________________________________________ ___________
> Desafio AntiZona - Um emocionante desafio de
> perguntas e respostas que
> te d=E1 um Renault Clio, kits de eletr=F4nicos,
> computadores, notebooks e=20
> mochilas. Cadastre-se, participe e concorra!
> www.cade.com.br/antizona
>=20
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org=20
=====3D
=C2ngelo Marcos Rigo
AMR Inform=E1tica=20
(51) 3348 0870=20
Rua Pe. Alois Kades 400/210=20
Porto Alegre /RS/Brasil
http://amr.freezope.org
angelo_rigo@yahoo.com.br
=20
____________________________________________________________ ___________
Desafio AntiZona - Um emocionante desafio de perguntas e respostas que
te d=E1 um Renault Clio, kits de eletr=F4nicos, computadores, notebooks e=
=20
mochilas. Cadastre-se, participe e concorra!
www.cade.com.br/antizona
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
Re: Update problem
am 19.08.2003 18:29:15 von Scott Marlowe
On Tue, 19 Aug 2003, =C2ngelo Marcos Rigo wrote:
> I have an update escript that works fine with text
> fields but with an textarea version the script is
> passing an empty value, for the "texto" field=20
> Here is a snip of code that receives the values:
>=20
> $id =3D $_POST['id'];
> $titulo =3D $_POST['titulo'];
> $resumo =3D $_POST['resumo'];
> $texto =3D $_POST['texto'];
> print_r($texto);
> include 'db.php';=20
> $query =3D "UPDATE revista SET titulo=3D'$titulo',
> resumo=3D'$resumo', texto=3D'$texto' WHERE id=3D'$id'";
>=20
> here is the "texto" field where i do write the
> modifications to be updated:
>=20
> print ("
Texto |
> rows=3D\"20\" value=3D\"$myrow[3]\"
> name=3D\"texto\">$myrow[3] |
");
Hi =C2ngelo, welcome to the php list.
Is the problem that the FORM is printed with an empty text area, or that,=
=20
after entering text into the textarea that it doesn't get inserted into=20
the database upon submission?
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Re: Update problem
am 19.08.2003 18:41:19 von angelo_rigo
Hi Scott
It=B4s strange but whith a little amount of text the
update works.
I have the same script with text field and it works
fine.
Now that i am using textarea because it handle a full
magazine article it is not working i do print $query
on the final script and return null.=20
It updates the title and abstract but the article wich
has a huge amount of text (with html tags inserted
from a built in javascript html editor).
Thank=B4s in advance
--- "scott.marlowe" escreveu:
> On Tue, 19 Aug 2003, =C2ngelo Marcos Rigo wrote:
>=20
> > I have an update escript that works fine with text
> > fields but with an textarea version the script is
> > passing an empty value, for the "texto" field=20
> > Here is a snip of code that receives the values:
> >=20
> > $id =3D $_POST['id'];
> > $titulo =3D $_POST['titulo'];
> > $resumo =3D $_POST['resumo'];
> > $texto =3D $_POST['texto'];
> > print_r($texto);
> > include 'db.php';=20
> > $query =3D "UPDATE revista SET titulo=3D'$titulo',
> > resumo=3D'$resumo', texto=3D'$texto' WHERE id=3D'$id'";
> >=20
> > here is the "texto" field where i do write the
> > modifications to be updated:
> >=20
> > print ("Texto |
> cols=3D\"90\"
> > rows=3D\"20\" value=3D\"$myrow[3]\"
> > name=3D\"texto\">$myrow[3] |
");
>=20
> Hi =C2ngelo, welcome to the php list.
>=20
> Is the problem that the FORM is printed with an
> empty text area, or that,=20
> after entering text into the textarea that it
> doesn't get inserted into=20
> the database upon submission?
>=20
>=20
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the
> unregister command
> (send "unregister YourEmailAddressHere" to
majordomo@postgresql.org)=20
=====3D
=C2ngelo Marcos Rigo
AMR Inform=E1tica=20
(51) 3348 0870=20
Rua Pe. Alois Kades 400/210=20
Porto Alegre /RS/Brasil
http://amr.freezope.org
angelo_rigo@yahoo.com.br
=20
____________________________________________________________ ___________
Desafio AntiZona - Um emocionante desafio de perguntas e respostas que
te d=E1 um Renault Clio, kits de eletr=F4nicos, computadores, notebooks e=
=20
mochilas. Cadastre-se, participe e concorra!
www.cade.com.br/antizona
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html
Re: Update problem
am 19.08.2003 19:31:09 von Scott Marlowe
I'm gonna guess that you've got CRs embedded or other text that needs=20
escaping. Are you using pg_escape_string before the insert?
On Tue, 19 Aug 2003, =C2ngelo Marcos Rigo wrote:
> Hi Scott
>=20
> It=B4s strange but whith a little amount of text the
> update works.
> I have the same script with text field and it works
> fine.
>=20
> Now that i am using textarea because it handle a full
> magazine article it is not working i do print $query
> on the final script and return null.=20
>=20
> It updates the title and abstract but the article wich
> has a huge amount of text (with html tags inserted
> from a built in javascript html editor).
>=20
> Thank=B4s in advance
>=20
> --- "scott.marlowe" escreveu:
> > On Tue, 19 Aug 2003, =C2ngelo Marcos Rigo wrote:
> >=20
> > > I have an update escript that works fine with text
> > > fields but with an textarea version the script is
> > > passing an empty value, for the "texto" field=20
> > > Here is a snip of code that receives the values:
> > >=20
> > > $id =3D $_POST['id'];
> > > $titulo =3D $_POST['titulo'];
> > > $resumo =3D $_POST['resumo'];
> > > $texto =3D $_POST['texto'];
> > > print_r($texto);
> > > include 'db.php';=20
> > > $query =3D "UPDATE revista SET titulo=3D'$titulo',
> > > resumo=3D'$resumo', texto=3D'$texto' WHERE id=3D'$id'";
> > >=20
> > > here is the "texto" field where i do write the
> > > modifications to be updated:
> > >=20
> > > print ("Texto |
> > cols=3D\"90\"
> > > rows=3D\"20\" value=3D\"$myrow[3]\"
> > > name=3D\"texto\">$myrow[3] |
");
> >=20
> > Hi =C2ngelo, welcome to the php list.
> >=20
> > Is the problem that the FORM is printed with an
> > empty text area, or that,=20
> > after entering text into the textarea that it
> > doesn't get inserted into=20
> > the database upon submission?
> >=20
> >=20
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 2: you can get off all lists at once with the
> > unregister command
> > (send "unregister YourEmailAddressHere" to
> majordomo@postgresql.org)=20
>=20
> =====3D
> =C2ngelo Marcos Rigo
> AMR Inform=E1tica=20
> (51) 3348 0870=20
> Rua Pe. Alois Kades 400/210=20
> Porto Alegre /RS/Brasil
> http://amr.freezope.org
> angelo_rigo@yahoo.com.br
> =20
>=20
>=20
> ____________________________________________________________ ___________
> Desafio AntiZona - Um emocionante desafio de perguntas e respostas que
> te d=E1 um Renault Clio, kits de eletr=F4nicos, computadores, notebooks=
e=20
> mochilas. Cadastre-se, participe e concorra!
> www.cade.com.br/antizona
>=20
> ---------------------------(end of broadcast)--------------------------=
-
> TIP 5: Have you checked our extensive FAQ?
>=20
> http://www.postgresql.org/docs/faqs/FAQ.html
>=20
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
Re: Update problem
am 19.08.2003 19:52:54 von angelo_rigo
No I am not using, i will try now. How do you use it
?pg_escape_string($sql) ?
--- "scott.marlowe" escreveu:
> I'm gonna guess that you've got CRs embedded or
> other text that needs=20
> escaping. Are you using pg_escape_string before the
> insert?
>=20
> On Tue, 19 Aug 2003, =C2ngelo Marcos Rigo wrote:
>=20
> > Hi Scott
> >=20
> > It=B4s strange but whith a little amount of text the
> > update works.
> > I have the same script with text field and it
> works
> > fine.
> >=20
> > Now that i am using textarea because it handle a
> full
> > magazine article it is not working i do print
> $query
> > on the final script and return null.=20
> >=20
> > It updates the title and abstract but the article
> wich
> > has a huge amount of text (with html tags inserted
> > from a built in javascript html editor).
> >=20
> > Thank=B4s in advance
> >=20
> > --- "scott.marlowe"
> escreveu:
> > > On Tue, 19 Aug 2003, =C2ngelo Marcos Rigo wrote:
> > >=20
> > > > I have an update escript that works fine with
> text
> > > > fields but with an textarea version the script
> is
> > > > passing an empty value, for the "texto" field=20
> > > > Here is a snip of code that receives the
> values:
> > > >=20
> > > > $id =3D $_POST['id'];
> > > > $titulo =3D $_POST['titulo'];
> > > > $resumo =3D $_POST['resumo'];
> > > > $texto =3D $_POST['texto'];
> > > > print_r($texto);
> > > > include 'db.php';=20
> > > > $query =3D "UPDATE revista SET
> titulo=3D'$titulo',
> > > > resumo=3D'$resumo', texto=3D'$texto' WHERE
> id=3D'$id'";
> > > >=20
> > > > here is the "texto" field where i do write the
> > > > modifications to be updated:
> > > >=20
> > > > print ("Texto |
> > > cols=3D\"90\"
> > > > rows=3D\"20\" value=3D\"$myrow[3]\"
> > > >
> name=3D\"texto\">$myrow[3] |
");
> > >=20
> > > Hi =C2ngelo, welcome to the php list.
> > >=20
> > > Is the problem that the FORM is printed with an
> > > empty text area, or that,=20
> > > after entering text into the textarea that it
> > > doesn't get inserted into=20
> > > the database upon submission?
> > >=20
> > >=20
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 2: you can get off all lists at once with
> the
> > > unregister command
> > > (send "unregister YourEmailAddressHere" to
> > majordomo@postgresql.org)=20
> >=20
> > =====3D
> > =C2ngelo Marcos Rigo
> > AMR Inform=E1tica=20
> > (51) 3348 0870=20
> > Rua Pe. Alois Kades 400/210=20
> > Porto Alegre /RS/Brasil
> > http://amr.freezope.org
> > angelo_rigo@yahoo.com.br
> > =20
> >=20
> >=20
> >
>
____________________________________________________________ ___________
> > Desafio AntiZona - Um emocionante desafio de
> perguntas e respostas que
> > te d=E1 um Renault Clio, kits de eletr=F4nicos,
> computadores, notebooks e=20
> > mochilas. Cadastre-se, participe e concorra!
> > www.cade.com.br/antizona
> >=20
> > ---------------------------(end of
> broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >=20
> > =20
> http://www.postgresql.org/docs/faqs/FAQ.html
> >=20
>=20
>=20
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please
> send an appropriate
> subscribe-nomail command to
> majordomo@postgresql.org so that your
> message can get through to the mailing list
cleanly=20
=====3D
=C2ngelo Marcos Rigo
AMR Inform=E1tica=20
(51) 3348 0870=20
Rua Pe. Alois Kades 400/210=20
Porto Alegre /RS/Brasil
http://amr.freezope.org
angelo_rigo@yahoo.com.br
=20
____________________________________________________________ ___________
Desafio AntiZona - Um emocionante desafio de perguntas e respostas que
te d=E1 um Renault Clio, kits de eletr=F4nicos, computadores, notebooks e=
=20
mochilas. Cadastre-se, participe e concorra!
www.cade.com.br/antizona
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Re: Update problem
am 21.08.2003 14:24:08 von angelo_rigo
Hi !!
I do this:
$titulo =3D pg_scape_string($_POST['titulo']);
$resumo =3D pg_scape_string($_POST['resumo']);
$texto =3D pg_scape_string($_POST['texto']);
but it do not work is it correct?
--- "scott.marlowe" escreveu:
> On Tue, 19 Aug 2003, =C2ngelo Marcos Rigo wrote:
>=20
> > Hi Scott
> >=20
> > You mean before i do insert the data in the
> database
> > do a clean up with:
> > $texto =3D pg_scape_string($_POST['texto']);
> > Crs mean carriage return?
> > why do it make the text dissapear?
>=20
> Not sure, I'm just guessing. Anytime you want to
> put text into the=20
> database you need to pg_escape_string($field) each
> field to make sure that=20
> ' characters get escaped. You can use
> remove_slashes() to get it off. =20
> I'm not sure why there's no pg_unescape_string()
> though.
> =20
=====3D
=C2ngelo Marcos Rigo
AMR Inform=E1tica=20
(51) 3348 0870=20
Rua Pe. Alois Kades 400/210=20
Porto Alegre /RS/Brasil
http://amr.freezope.org
angelo_rigo@yahoo.com.br
=20
____________________________________________________________ ___________
Desafio AntiZona - Um emocionante desafio de perguntas e respostas que
te d=E1 um Renault Clio, kits de eletr=F4nicos, computadores, notebooks e=
=20
mochilas. Cadastre-se, participe e concorra!
www.cade.com.br/antizona
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Re: Update problem
am 21.08.2003 14:28:21 von Gerd Terlutter
pg_scape_string() ?
better
pg_escape_string() ?
=C2ngelo Marcos Rigo wrote:
> Hi !!
>=20
> I do this:
>=20
> $titulo =3D pg_scape_string($_POST['titulo']);
> $resumo =3D pg_scape_string($_POST['resumo']);
> $texto =3D pg_scape_string($_POST['texto']);
>=20
> but it do not work is it correct?
>>>do a clean up with:
>>>$texto =3D pg_scape_string($_POST['texto']);
>>Not sure, I'm just guessing. Anytime you want to
>>put text into the=20
>>database you need to pg_escape_string($field) each
--=20
--------------------------------------------------------
# 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 #
--------------------------------------------------------
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
Re: Update problem
am 21.08.2003 15:43:21 von angelo_rigo
Thank=B4s the pg_escape_string works, i still turn the
wrap atributte from the textarea to virtual=20
But at the update part of the scripts doing a print
query return me:
UPDATE revista SET titulo=3D'ASILO PADRE CACIQUE ',
resumo=3D'Sociedade Humanit=E1ria Padre Cacique fundada em
12 de maio de 1982, entidade particular com fins
beneficentes.', texto=3D'' WHERE id=3D'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)
=09
$id =3D $_POST['id'];
$titulo =3D pg_escape_string($_POST['titulo']);
$resumo =3D pg_escape_string($_POST['resumo']);
$texto =3D pg_escape_string($_POST['texto']);
var_dump($texto);
print("
");
print_r($texto);
print("
");
include 'db.php';=20
$query =3D "UPDATE table SET titulo=3D'$titulo',
resumo=3D'$resumo', texto=3D'$texto' WHERE id=3D'$id'";
print $query;
$result =3D pg_query($db, $query);
if (!$result) {printf ("ERROR"); exit;}
print ("Estes valores foram atualizados:
-
$id
- $titulo
- $resumo
- $texto
");
pg_close($db);
?>=20
--- Gerd Terlutter escreveu: >
pg_scape_string() ?
> better
> pg_escape_string() ?
> =C2ngelo Marcos Rigo wrote:
> > Hi !!
> >=20
> > I do this:
> >=20
> > $titulo =3D pg_scape_string($_POST['titulo']);
> > $resumo =3D pg_scape_string($_POST['resumo']);
> > $texto =3D pg_scape_string($_POST['texto']);
> >=20
> > but it do not work is it correct?
> >>>do a clean up with:
> >>>$texto =3D pg_scape_string($_POST['texto']);
> >>Not sure, I'm just guessing. Anytime you want to
> >>put text into the=20
> >>database you need to pg_escape_string($field) each
>=20
>=20
> --=20
>
--------------------------------------------------------
> # Gerd Terlutter | Mueller+Blanck Software
> GmbH #
> # gerd@MplusB.de | Gutenbergring 38 =20
> #
> # gerd.terlutter@web.de | D-22848 Noderstedt =20
> #
> # tel:0171/6992579 | tel:+49 40 500 171-1 =20
> #
> # Buero:040/500171-17 | fax:+49 40 500 171-71 =20
> #
>
--------------------------------------------------------
>=20
> =20
=====3D
=C2ngelo Marcos Rigo
AMR Inform=E1tica=20
(51) 3348 0870=20
Rua Pe. Alois Kades 400/210=20
Porto Alegre /RS/Brasil
http://amr.freezope.org
angelo_rigo@yahoo.com.br
=20
____________________________________________________________ ___________
Desafio AntiZona - Um emocionante desafio de perguntas e respostas que
te d=E1 um Renault Clio, kits de eletr=F4nicos, computadores, notebooks e=
=20
mochilas. Cadastre-se, participe e concorra!
www.cade.com.br/antizona
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if you=
r
joining column's datatypes do not match