RE: [PHP] to array or not to array..
| From: | (Edward Peloke) | Date: | Mon, 12 Jan 2004 21:31:39 +0000 |
| Subject: | RE: [PHP] to array or not to array.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174374@lists.php.net to get a copy of this message | ||
Thanks Shawn,
That works great, I am messing myself up, however because I am using
checkboxes so when I run this, if I have unchecked the checkbox, the value
doesn't come through and I want an unchecked box to be 0 for example so I
may need some javascript...
Thanks,
Eddie
-----Original Message-----
From: shawn_milochik@godivachoc.com
[mailto:shawn_milochik@godivachoc.com]
Sent: Monday, January 12, 2004 3:00 PM
To: epeloke@echoman.com
Cc: php-general@lists.php.net
Subject: Re: [PHP] to array or not to array..
Try adapting like this:
foreach ($_POST as $key => $val){
#display each item from submitted form
print "$key: $val<br>";
}
Shawn
epeloke@echoman.c
om To:
php-general@lists.php.net
cc:
01/12/2004 02:44 Subject: [PHP] to array or
not to array..
PM
Ok,
This is probably a basic question, I am just looking for opinions and
examples as to the best way to handle this...
I cycling through a query and displaying results to the user such as ...
username can add can delete
eddie Y N
frank N N
martha Y Y
each of the 'Y's and 'N's represent a checkbox. The user can click
checkboxes for several users then click the update button. When they click
the update button, I then need to loop through and make updates to the
table
for each client. What is the best way to handle this? Should these values
be put into a multidemensional array keyed off the users id then loop
through the array to insert into the table? Should I not use an array and
just someone loop through the results?
Thanks,
Eddie
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
**********************************************************************
This e-mail and any files transmitted with it may contain
confidential information and is intended solely for use by
the individual to whom it is addressed. If you received
this e-mail in error, please notify the sender, do not
disclose its contents to others and delete it from your
system.
**********************************************************************