when i try to run this code :
<?php
$str = "Patty O'Furniture";
if(get_magic_quotes_gpc())
echo stripslashes($str);
?>
the output is Patty O'Furniture but when i try to run this code(upload data into database table)
<?php
if ($_FILES[csv][size] > 0) {
//get the csv file
$file = $_FILES[csv][tmp_name];
$handle = fopen($file,"r");
//loop through the csv file and insert into database
do {
if ($data[0]) {
if(get_magic_quotes_gpc())
mysql_query("INSERT INTO sms_recipient (store_id, recipient_name, recipient_phone) VALUES
(
'".$login_id."',
'".stripslashes($data[0])."',
'".stripslashes($data[1])."'
)
");
}
} while ($data = fgetcsv($handle,1000,",","'"));
//
}
?>
the output only Patty O . (see screenshot)

i’m not sure why when i try to save data into database using function stripslashes it’s not working.
Because you’re undoing what magic_quotes is trying to do.
So you’re removing the backslashes via
stripslashesthat are being added, and shorting the query when it hits the'inO'Furniture