Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP: converting html tags to line breaks in MySQL

Participant ,
Oct 24, 2008 Oct 24, 2008
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!
TOPICS
Server side applications
435
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 24, 2008 Oct 24, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 16, 2009 Feb 16, 2009
LATEST
thanks gary!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines