/    Sign up×
Community /Pin to ProfileBookmark

Storing a in mysql?

I am trying to use php to put some information into a mysql database and it involves some which mysql doesn’t seem to be able to store directly? I’m not sure if this is a problem with the sql statement or that mysql just plain can’t store a ?

I would assume there is some sort of escape needed to get it in? And then unescape once you pull it out again? Or is there an easier way? I already use this data in many areas and it would be possible to go escape and unescape everywhere I use it but definitely a hassle.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@MatMelJul 26.2007 — You have to escape it with another :

""

You can also let the myslq function "mysql_real_escape_string" do it for you.
Copy linkTweet thisAlerts:
@xvszeroauthorJul 26.2007 — Thanks, the function worked fine.

Plus it doesn't seem to require an unescape or anything, which saves me a LOT of hassle. Because I really only write to this data in two areas, but I use it everywhere.
×

Success!

Help @xvszero spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...