Re: to array or not to array..

From: Date: Mon, 12 Jan 2004 21:08:43 +0000
Subject: Re: to array or not to array..
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-174373@lists.php.net to get a copy of this message
Edward Peloke wrote:
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
I would use an array or arrays using [] syntax in the HTML variable names. <input type="checkbox" name="userCanAdd[1]"/> -- paperCrane <Justin Patrin>

« previous php.general (#174373) next »