# Addslashes();

**URL:** <https://forum.kirupa.com/t/addslashes/277748>\
**Category:** Uncategorized\
**Created:** [December 16, 2008, 8:33pm UTC](https://forum.kirupa.com/t/addslashes/277748 "2008-12-16T20:33:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valerij](https://avatars.discourse-cdn.com/v4/letter/v/e68b1a/32.png) [@Valerij](https://forum.kirupa.com/u/Valerij)\
**Post date:** [December 16, 2008, 8:33pm UTC](https://forum.kirupa.com/t/addslashes/277748/1 "2008-12-16T20:33:54Z")

</div>

Hi guys,  
I’m having problems with PHP addslashes() function. Its a function that is meant to protect database from injections by adding slashes. In PHP manual;  
[http://no.php.net/manual/en/function.addslashes.php](http://no.php.net/manual/en/function.addslashes.php)  
It says: “This would only be to get the data into the database, the extra \ will not be inserted.”

For some reason this is not what happens in my case, I get 1 extra slash which then goes to the database… Why? Should I use stripslashes() function to get rid of them? I mean… Its not supposed to be this way…
