This is a discussion on "[SOLVED] Saving values from checkboxes into MySql" within the PHP Forum section. This forum, and the thread "[SOLVED] Saving values from checkboxes into MySql are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Saving values from checkboxes into MySql
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
[SOLVED] Saving values from checkboxes into MySql
I have form where I'm displaying checkboxes with data taken from a MySQL table
1-3-7 I think this is the easiest way... What I want to know is, then user clicks submit, how do go about grabbing the ones that were checked and putting them in the format above? |
|
|
|
||||
|
Re: Saving values from checkboxes into MySql
When a user clicks a form that has checkboxes, only the checked boxes are sent. Any that were left unchecked don't even arrive at the next page.
Then with php, you can just check if the name of the checkbox exists
In its current form, PHP will only receive the last checkbox ticked because all previous one's will be overwritten by the last. Alternatively, you can name your checkboxes with
Hope that helps.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
||||
|
Re: Saving values from checkboxes into MySql
Drats, the one time karinne needs help I get beaten by Rakuli to the punch! Man, I wanted to help! haha
Last Blog Entry: Happy Holidays - A Non Offensive way to say Merry Christmas? WRONG! (Dec 11th, 2007)
|
|
||||
|
Re: Saving values from checkboxes into MySql
Yes.. okay so say you go for the multi-form array option and your form turns out like this
Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
||||
|
Re: Saving values from checkboxes into MySql
Ah ... poor Justin ... got beaten by Rakuli again
Peeeerfect! Thanks Rakuli! |
|
||||
|
Re: Saving values from checkboxes into MySql
Quote:
You're welcome.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
||||
|
Re: Saving values from checkboxes into MySql
NOOESS!!! lol I think Rakuli is a hogging the forumz :P. Well good job Rakuli.
Last Blog Entry: Happy Holidays - A Non Offensive way to say Merry Christmas? WRONG! (Dec 11th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Form to email script with checkboxes | Posie | PHP Forum | 4 | Dec 10th, 2007 03:54 |
| [SOLVED] preserve the state of checkboxes after an AJAX call | pesho318i | JavaScript Forum | 4 | Nov 7th, 2007 16:35 |
| [SOLVED] saving data from one array into another | eon201 | PHP Forum | 2 | Nov 7th, 2007 09:34 |
| Assign string values to integer values of a session variable | Andy K | Classic ASP | 1 | Jul 13th, 2005 08:29 |
| [SOLVED] Presenting binary values | Anonymous User | Classic ASP | 3 | Dec 7th, 2004 17:50 |