/    Sign up×
Community /Pin to ProfileBookmark

Daily noob question

Once again, I turn to you all, the experts, with what will probably end up being yet another noob question.

OK I’m using a html text editor to capture “news” items, then posting them to the main page. The problem lies when someone uses a ‘ in the editor. Basicly because I’m capturing this as a variable when I get to my update statement the first ‘ that comes up in the text ends that variable. I’m not sure this makes sense, so I’ll post a sudo-example and update statment.

[B]OK lets pretend that the following is written into the editor:[/B]

[I]This is hard and I don’t know what to do[/I]

[B]Then on submit it is transfered as:[/B]

[I]$news[/I]

[B]Now when the update statment is read:[/B]

[I]$updatestatment = “update news set news = ‘$news’ where id = $id;[/I]

[B]As the contents of $news is written it gets to the ‘ in don’t and considers that as the end of the data and pukes.[/B]

The more I read this, the more I get the feeling that I’m not doing a good job of relaying my question.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@Doc_ThirstauthorJan 05.2006 — Please disregard this. Turns out a hangup with the editor not the code. Thanks for all that viewed.
×

Success!

Help @Doc_Thirst 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,
)...