views:

45

answers:

1

Problem when I enter any input which has underscore (_) data will store to my db looks like this image\_background.png

Example

$image = stripslashes($_POST['image']); // example image name image_background.png
$query = 'UPDATE product SET image="'.  $db->string_escape($image, true).'" WHERE id="'. intval($id).'"';

The problem coming when input has underscore only. If without underscore all backslashes will remove by the stripslashes

Let me know.

+1  A: 

$db->string_escape adding it?
and why do you use stripslashes at all?

Col. Shrapnel
yes added.. but wont work on this part.
bob
i removed the $db->string_escape and now working. thanks. weird.
bob