Jump to content


Photo

PHP MySQL: escaping all special characters


  • Please log in to reply
1 reply to this topic

#1 vaibhavs

vaibhavs
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 01 June 2006 - 11:47 AM

Hi,

I am sure this must have been discussed many times before, but I could not get much info upon searching.

I am writing simple scripts to Add / Delete / Modify records in MySQL.

Special characters like single quotes, double quotes, back slash, front slash, dollar etc cause a havoc when interacting with MySQL.

What is the best way to handles these characters (and other characters which I have missed above) such that they are displayed correctly when viewing, adding & modifying records.

All suggestions / examples / pointers are thanked in advance.

Thx.
regards,
Vai

#2 samshel

samshel
  • Members
  • PipPipPip
  • Advanced Member
  • 837 posts

Posted 01 June 2006 - 11:52 AM



addslashes(); or

mysql_escape_string();
Cheers,
SamShel
-----------------------------------------------
--: FUTURE IS LINUX :--
-----------------------------------------------




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users