problem with ' in a string of an update

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

problem with ' in a string of an update

Post by pelegk2 »

i have this update :

Code: Select all

$SET=" Set_name='".addslashes($Set_name)."',
and the

Code: Select all

$Set_name= blabla'balvla
when i do this update i see in the db :
blabla''balvla
must i have this i the db?
if yes it means i need to use stripslashes all the time
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yes...
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

Bad link? "Error: http://www.pinkgoblin.com cannot be found."
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Site must be down - hopefully it'll be back up soon.
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post by hedge »

what DB, I use Oracle and when I escape the quotes it has the smarts to store the data properly. example I quote it like this "bob''s cat can''t dance".

I can't believe any db would store the escape chars, that's hokey.
Post Reply