jimot
Mar 6th, 2006, 08:13 PM
hi all.. do you really need addslashes() to store data into mysql?
Because I tried this:
$item = "jim's";
$item = addslashes($item);
if I echo $item then $item is "jim\'s" then I store $item into mysql database table.
But when I retrieve it using SELECT, even if I don't use stripslashes(), the result is "jim's" NOT "jim\'s". So what do I use the addslashes() for in the first place? :confused:
thanks
Because I tried this:
$item = "jim's";
$item = addslashes($item);
if I echo $item then $item is "jim\'s" then I store $item into mysql database table.
But when I retrieve it using SELECT, even if I don't use stripslashes(), the result is "jim's" NOT "jim\'s". So what do I use the addslashes() for in the first place? :confused:
thanks