/    Sign up×
Community /Pin to ProfileBookmark

Simple Example of Check Box to update MySQL Field Needed

I have an HTML Form the is to be filled out by a user…the Form already includes one radio button and one checkbox….this form is an emample form I grabbed from a sample website to use as a testing ground.

When I tried editing the form by adding another checkbox, i couldn’t get it to work at all……Can anyone please tell give me a very simple set of code( HTML & PHP ) to update a MySQL field. My goal is to have a user decide if he like Pepsi.

So do you like Pepsi? checkbox for yes

and that’s it……then the php updates the MySQL value to 1 for yes otherwise leave as default 0 for no…

Any help would be very much appreciated….

Thank You

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@YelgnidrocSep 21.2007 — For a question such as "do you like pepsi" I would have a yes/no radio button.

I would only use checkboxes where a selection of answers may be true. e.g. which of the following do you like: pepsi, coke, water, milk, bleach.

If you could post your code perhaps someone could see where it might be improved.
×

Success!

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