Amen.  Translating user input into HTML is great until you need to read
the data *out*, and someone decides the output should be formatted as
RTF or PDF or text.  Best to store it as you got it, IMO.

> -----Original Message-----
> From: Alan Williamson [mailto:[EMAIL PROTECTED] 
> Sent: Friday, September 09, 2005 10:11 AM
> To: mysql@lists.mysql.com
> Subject: RE: HTML in MySQL?
> 
> > If you use textarea field of a form, it produces "null" 
> characters (\n) in 
> the 
> > end of every string. I recommed to replace them with "<br>" 
> tags before 
> > writing into the database. It'll help to avoid output problems. Use 
> > preg_replace(); for it.
> 
> Be careful here Vladimir, the (\n) are not 'null' characters; 
> but newline
> characters.  And i would highly recommend *not* replacing 
> them with <br>
> tags as you write them into the database.  This is asking for 
> trouble on
> so many levels.
> 
> The database will cope with carriage returns and newlines 
> just like any
> other character, so will have no problems.
> 
> HTML is just string; treat it as such and don't give it anymore credit
> than that and you'll be fine.
> 
> -- 
>  Alan Williamson, Technology Evangelist
>  SpikeSource Inc.
>  Daily OS News @ http://compiledby.spikesource.com/
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to