In my code i am using addslashes to escape certain characters while inserting them into the database and when i send some information out i use stripslashes to remove those slashes, the situation is stripslashes function removes all the slashes so if i need to send any string which has backslashes those also get removed. How can i retain those required slashes.
Any help will be greatly appreciate.
You might want to try using mysql_real_escape_string. You don’t have to unescape it, and it is safe for database use.
Better yet, use prepared statements