View Single Post
Old 07-23-07, 07:27 PM   #4
SoireeExtreme
Registered User
 
Join Date: Jul 2007
Posts: 5
Default Re: Save coding to database

Thanks for the help, but I do not understand the str_replace();. I was reading the php manual but that didn't help. I forgot to tell you that I am still fairly new to php and mysql both. So please bare with me. But to give a bit more info.

rn is exactly how it looks when I hit the enter key for a new blank line just like typing a document.

I use
PHP Code:
     print "Headline:<br><textarea name='headline' rows='1' cols='60'>$userstats3[headline]</textarea><br>";
as my text area

and I use
PHP Code:
    if(isset($_POST['submit']))
    {

    
$headline=$_POST['headline'];

      
$SQL = "update d_users set headline='$headline'where username='$userstats3[username]'";
      
mysql_query($SQL) or die("could not register");
      echo
"<center>Updated.";
to save it to the database.


And when I have everything print out onto another page it comes out like this...


rn = new line done by enter key

words words words.rnrnwords words.

so in the process of saving it is converted someone from a new line to the rn. This helps. Please explain to me how to fix this problem. Because as I said the manual doesn't help me. I'm more of a hands on person. In the mean time I'll keep trying to figure this out and let you know if I do.
SoireeExtreme is offline   Reply With Quote