Hey, I have a newbie question here, but it's killing me- I can't figure out this simple problem...

I'm using php to insert some values into a table, and i use this statement:

$sql = "INSERT INTO stories (stitle) VALUES('".addslashes($stitle)."')";

this is EXACTLY the same as a line i used in a different project which worked perfectly.

But for some reason in this project i'm working on now- when inserting into a table (where stitle is of the same type- varchar(70) ) none of the slashes from 'addslashes' are inserted into the table.

as an alternative (and to debug)- i tried moving the addslashes call to a line before creating the sql querry, like--

$title= addslashes($stitle);
echo $title;
$sql = "INSERT INTO stories (stitle) VALUES('".$title."')";

After echoing the variable, i could see that the slashes ARE definitely being added- but even when I do it this way the slashes are lost once the value is inserted into the table. In my other project I can see the slashes in the table fine (using the comand line or phpMyAdmin, so i know it's not a problem with them just not being displayed). I'm very new to database programming, so I'm sure it could be a few things- but after echoing the variable directly before adding it and seeing the slashes there, I just have no idea what it could be. Is there some kind of setting that makes mysql automatically remove the slashes on entry? I don't remember doing anything differently when creating this DB than when I created the one that works fine. Could someone please help me out??


Tyree G.