save textarea from flash to Mysql db using lines

Hello, I'm trying to save the text on my textArea from flash into Mysql Database, but when I save it, do not respect the lines. If I put:

aaa
bbb
ccc

in Mysql database I see aaabbbccc.

The code that I have in php is this:

<?php

$key3 = $HTTP_GET_VARS[nota];


$actualitza = mysql_query("UPDATE comanda SET nota ='".$key3)"'");

?>

what can I do?

thanks
jbadiaAsked:
Who is Participating?
 
phonglongConnect With a Mentor Commented:
I don't know how to post data in flash either, but if you want to use your current method, add in a delimiter like && into your text before you send it from flash... so have flash replace carriage returns or line feeds to &&, then you should get this in your php script:

aaa&&bbb&&ccc&&

i'm not familiar at all with flash scripting to tell you how to do it in flash, but this page i found on google seems to point in the right direction:

http://www.flzone.net/showDetail.asp?TypeId=44&NewsId=7678

the next thing to do would be to do a

$key3 = str_replace ( "&&", "\n", $key3 );

then insert into mysql.  kinda hacky, but i hope that helps

good luck.
0
 
alain34Commented:
first you should use a post method as opposed to a get, because get variable are url translated!
second you should convert return carriage to something like <br /> therefore you are sure that it will displayed correctly when send to a browser!
0
 
jbadiaAuthor Commented:
How can I convert return carriage to <br />?

then, my code will be similar to this?

<?php

$key3 = $HTTP_POST_VARS[nota];


$actualitza = mysql_query("UPDATE comanda SET nota ='".$key3)"'");

?>
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
alain34Connect With a Mentor Commented:
$key3    = str_replace ("\n", "<br />", $HTTP_POST_VARS[nota]);
0
 
jbadiaAuthor Commented:
I've tried but now, it don't save nothing.
In my flash I have this code to send variables:

on (press) {

 loadVariablesNum("insertvendes.php?nota="+_parent._parent.nota.text, 0);
}

Now, in my php, this:

<?php
$key3 = str_replace ("\n", "<br />", $HTTP_POST_VARS[nota]);
$actualitza = mysql_query("UPDATE comanda SET nota ='".$key3."'");
?>
0
 
alain34Commented:
I don't know flash, but I'm afraid this way a post will not work.
you need to revert to GET unless you know how to post data from flash!
0
 
jbadiaAuthor Commented:
thanks guys
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.