mysql_escape_string() not working as planned

This is a discussion on "mysql_escape_string() not working as planned" within the PHP Forum section. This forum, and the thread "mysql_escape_string() not working as planned are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old May 12th, 2008, 00:59
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 22 Times in 22 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
mysql_escape_string() not working as planned

I have a simple query that inserts a string into a table. I'm using mysql_escape_string() to escape all quotation marks and apostrophes. But the inserted values keep the double backslashes that mysql_escape_string inserted. How do I escape the values but prevent the backslashes from being inserted?
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
Reply With Quote

  #2 (permalink)  
Old May 13th, 2008, 15:25
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,649
Thanks: 0
Thanked 8 Times in 8 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: mysql_escape_string() not working as planned

I dont understand what you mean; Can you give us an example of what you are entering, and what it looks like in the database? If you dont add backslashes, you aren't escaping the values..
Reply With Quote
  #3 (permalink)  
Old May 13th, 2008, 17:14
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 942
Blog Entries: 8
Thanks: 2
Thanked 22 Times in 22 Posts
Send a message via AIM to CloudedVision Send a message via MSN to CloudedVision Send a message via Skype™ to CloudedVision
Re: mysql_escape_string() not working as planned

Nevermind. Turns out the values were previously escaped. Still don't know why........
__________________
echo "Take it easy, ".$CloudedVision;
.links { site: other-road-design; blog: only-nerds-allowed; project: resource-fish; organization: ARMIES6; }
<quote>&quot;I think it's wrong that only one company makes the game Monopoly&quot; - <name>Steven Wright</name></quote>
Last Blog Entry: More Cheat Sheets (Jul 12th, 2008)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS not working in IE? Jgag Web Page Design 2 Jun 5th, 2008 11:14
Why is this not working! Jack Franklin PHP Forum 7 Mar 25th, 2008 10:34
PNG - IE not working Phixon Web Page Design 3 Nov 30th, 2007 13:47
More new features planned! Rob Announcements and News 0 Dec 15th, 2006 22:23


All times are GMT. The time now is 02:09.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43