Now my query, SP is breaking if i enter
ssds ‘ ” ‘ sdsds
or just
‘ ” ‘
this is for mainly search functionality.
Which will be the best way to avoid all possibilities.
eg: str_replace or better ways.. write some function!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You didn’t mention which DBMS, so I’m assuming MySQL here.
The best way would be to use PDO and/or prepared statements. The next best way would be to use mysql_real_escape_string() if you are using the procedural API.