Re: how to access checkboxes & get them into database
| From: | Russ Michell | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: how to access checkboxes & get them into database | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14918@lists.php.net to get a copy of this message | ||
I don't think you need to get into global variables unless you *really* need to. In this case
it
sounds as if you don't.
OK so you have an array of checked values, so what's next? You wanna get those variables outta
that
array in your process script, and perform whatever it is you want (inserts, updates etc) upon those
variables.
so:
foreach($array as $key=>$val) {
echo "<p><b>$key: </b>" . "$val</p>";
}
This will echo the array's keys (labels, whatever) and their associated values to the page.
(just
so you can see what's going on)
You can now use these vars ($key and $val) to perform your DB inserts updates etc.
I hope that was of use to you.
Regards:
Russ
On Tue, 11 Dec 2001 12:14:01 +0100 es said <essaid@spacedealer.de> wrote:
> hi there,
> this time i've got another problem with my set of database-tables:
> i created a database (containing 6 tables) and some html-sheets for the in-
> and output. so far, so good.
> some values should be added to ONE of those tables table by checking
> checkboxes in a form.
> okay, the checked values of the checkboxes go into an array, which is given
> to the processing php-sheet as globals, but furtheri don't get yet.
> can someone please help me?
> all thanx !!!
> cornelia
>
>
> _____________________________________________________
>
> spacedealer GmbH
>
> Paul-Lincke-Ufer 42-43
> 10999 Berlin
> 030 / 695350-0
>
#-------------------------------------------------------#
"Believe nothing - consider everything"
Russ Michell
Anglia Polytechnic University Webteam
Room 1C 'The Eastings' East Road, Cambridge
e: r.j.michell@apu.ac.uk
w: www.apu.ac.uk/webteam
www.theruss.com
#-------------------------------------------------------#