Jump to content


Photo

How to input <HTML> formatted string inside MySQL table?


  • Please log in to reply
3 replies to this topic

#1 bilis_money

bilis_money
  • Members
  • PipPipPip
  • Advanced Member
  • 621 posts

Posted 13 July 2006 - 11:29 PM

If hope this is possible.

i want to input
"<br>Testing<b>"
inside MySQL database.
and to be able to display it back up again in <HTML> format string.

Is this possible? a simple snippet of codes for this will bendicate me.

thank you very much in advance.

#2 bilis_money

bilis_money
  • Members
  • PipPipPip
  • Advanced Member
  • 621 posts

Posted 13 July 2006 - 11:54 PM

i guess the function --> htmlspecialchars
will solve this problem, ok i'll try to figure it out by myself.

But if you have smarter way to do this then please tell me.


#3 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 14 July 2006 - 12:19 AM

When storing the string in your database use the function mysql_real_escape_string(), when sending it to the browser, use htmlentities().

Ken

#4 bilis_money

bilis_money
  • Members
  • PipPipPip
  • Advanced Member
  • 621 posts

Posted 14 July 2006 - 08:20 AM

thanks ken!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users