Skip to main content
Participant
October 24, 2008
Question

PHP: converting html tags to line breaks in MySQL

  • October 24, 2008
  • 2 replies
  • 434 views
hi guys,

i developed a php form that sends to email and save the info to a MySQL database at the same time.

The challenge I'm encountering is when special characters like "'" are included in one of the text areas, then I get a mysql syntax error.

I got a tip that I need to create a script that will strip the special characters.

Can anyone point me to the right direction? Thanks!
This topic has been closed for replies.

2 replies

Harumbak_Author
Participant
February 16, 2009
thanks gary!
Inspiring
October 25, 2008
On Fri, 24 Oct 2008 23:22:29 +0000 (UTC), "Harumbak!"
<webforumsuser@macromedia.com> wrote:

> The challenge I'm encountering is when special characters like "'" are
>included in one of the text areas, then I get a mysql syntax error.

Use PHP's mysql_real_escape_string() function to escape the special
characters:

http://php.net/mysql_real_escape_string

Gary