Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in PHP only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
PHP
problems when insert a charcter ' into database
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
perhapscwk
New Member
Join Date:
Sep 2007
Posts:
123
#1
problems when insert a charcter ' into database
Oct 16 '09, 04:43 PM
MY PHP form...i use it to submit and then insert data into SQL.
but why if i have a words like he's , then it will output as he\\\\\\\'s ?
Dormilich
Recognized Expert
Expert
Join Date:
Aug 2008
Posts:
8694
#2
Oct 16 '09, 05:00 PM
there seem to be multiple escaping functions (e.g.
addslashes()
) at work. best is you use the typographical quotation mark ’.
Comment
Post
Cancel
Atli
Recognized Expert
Expert
Join Date:
Nov 2006
Posts:
5062
#3
Oct 16 '09, 06:18 PM
Make sure you don't have
Magic Quotes
enabled.
(See
get_magic_quote s_gpc
)
It escapes quotes in incoming data before it even reaches your PHP code.
If it is enabled, you would need to use
stripslashes
on the data before using it.
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment