|
Posted by wes.waters on 01/14/08 22:36
First post here, so please go easy on me. I'm certainly a novice at
best using PHP/MySQL.
I have a table containing ID_NO, Name, SPRIDEN_ID. This table
contains information about event attendees. This data must later be
cleansed and SPRIDEN_ID should be added to this table if the attendee
is a constituent of ours or set to NULL (rather than deleted) if they
are not a constituent.
Since I am using MySQL and PHP I have created a web form that allows
the data to be cleansed. The PHP page simply extracts all attendee
information where the SPRIDEN_ID is not NULL or = 0 (as the column is
defined as INT, this is the default) and creates a php table where
each row provides the option to 1. input a SPRIDEN_ID in a text field
or 2. mark the SPRIDEN_ID as null via a checkbox. The user should
have functionality that will allow them to cleanse however many rows
they so choose in one sitting, adding SPRIDEN_ID or marking SPRIDEN_ID
as NULL until an indefinite point, then press submit and have the
updates applied using MySQL to the database table, whether they have
cleansed all the rows of data or not.
Since this is a webform that is built off dynamic content, it creates
a row in the php table for every row in the database table where the
SPRIDEN_ID meets the above criteria. The field names, however, are
named the same thing over and over. I have found that this does not
work well, as the $_POST array reads these are key collisions and only
stores the final instance. What is the optimal way to name my form
fields here? Should I prepend an iterated number to each form field
name and then split it out into an associative array while reading the
$_POST data? Should I use php EXTR_PREFIX_ALL?
I have found little documentation on this problem and have been
searching for awhile. Any help would be greatly appreciated.
Navigation:
[Reply to this message]
|