Re: [PHP-DB] array from html form
the subarrays contain variable data and I tried to express that by showing the array structure that way if I access $needed_data[0] it would be an array of two pieces of data ( both variable) $needed_data[1] would also be an array of two variable pieces of data, etc if I loop through them all I can use each "member_id / position " pair to update a database but I have no way to know how many such pairs there will be, and the actual values of $member_id and of $position will be different in each case I hope that helps, sorry I'm not more skilled at expressing this > For one, why are you redefining the array 3 times in that script? ... > I'm trying to follow here... and its not making sense. > > I need to build a multidimensional array from a html form, > the array would look like: > > $needed_data = array ( > array (id = $member_id, > points = $position ), > array ( id = $member_id, > points =$position), > array (id=$member_id, > points = $position); > > $member_id will be used to dynamically build the html form, $position > will be an integer entered into a text field in that form similar to > this: > > Fred($member_id=?) .. [ enter position=? ] > John)$member_id=?) ..[enter position=?] > etc > etc > [SUBMIT] > > IF ( I can get the data into an array like above) { > I can make the rest of the script work } > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] array from html form
For one, why are you redefining the array 3 times in that script? ... I'm trying to follow here... and its not making sense. -Original Message- From: Larry Linthicum [mailto:[EMAIL PROTECTED]] Sent: Friday, October 05, 2001 12:14 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] array from html form Hi I'm just a PHP "hobbiest" trying to build a points calculating system for another hobby, please bear with me. I need to build a multidimensional array from a html form, the array would look like: $needed_data = array ( array (id = $member_id, points = $position ), array ( id = $member_id, points =$position), array (id=$member_id, points = $position); $member_id will be used to dynamically build the html form, $position will be an integer entered into a text field in that form similar to this: Fred($member_id=?) .. [ enter position=? ] John)$member_id=?) ..[enter position=?] etc etc [SUBMIT] IF ( I can get the data into an array like above) { I can make the rest of the script work } but that is a big "if" ... how can I stucture the form and get that multidimen array from the single name/value pairs passed from an html form? OR Maybe I can make a normal array work? I know that enclosing form field names in [] makes them available as an array if the form were dynamically built like PERSONS NAME (from database via $member_id ) next PERSONS NAME (from database via $member_id ) next PERSONS NAME (from database via $member_id ) etc etc I "think" I would then send an array containing all the $member_id (s) and all the entries into the txt fields first... am I correct in that? second ... is the indexing order known and guaranteed? in other words is $data[0] and $data[1] OR $data[12] and $data[13] ALWAYS going to represent a "matched" pair? ( from "one line" of the form } or is the indexing of the array subject to variation and may NOT be in the same order as the [data] fields in the html ? What if nothing is entered into the txt field?I know that enclosing form field names in [] makes them available as an array if the form were dynamically built like PERSONS NAME (from database via $member_id ) next PERSONS NAME (from database via $member_id ) next PERSONS NAME (from database via $member_id ) etc etc I "think" I would then send an array containing all the $member_id (s) and all the entries into the txt fields first... am I correct in that? second ... is the indexing order known and guaranteed? in other words is $data[0] and $data[1] OR $data[12] and $data[13] ALWAYS going to represent a "matched" pair? ( from "one line" of the form } or is the indexing of the array subject to variation and may NOT be in the same order as the [data] fields in the html ? What if nothing is entered into the txt field? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] array from html form
Hi I'm just a PHP "hobbiest" trying to build a points calculating system for another hobby, please bear with me. I need to build a multidimensional array from a html form, the array would look like: $needed_data = array ( array (id = $member_id, points = $position ), array ( id = $member_id, points =$position), array (id=$member_id, points = $position); $member_id will be used to dynamically build the html form, $position will be an integer entered into a text field in that form similar to this: Fred($member_id=?) .. [ enter position=? ] John)$member_id=?) ..[enter position=?] etc etc [SUBMIT] IF ( I can get the data into an array like above) { I can make the rest of the script work } but that is a big "if" ... how can I stucture the form and get that multidimen array from the single name/value pairs passed from an html form? OR Maybe I can make a normal array work? I know that enclosing form field names in [] makes them available as an array if the form were dynamically built like PERSONS NAME (from database via $member_id ) next PERSONS NAME (from database via $member_id ) next PERSONS NAME (from database via $member_id ) etc etc I "think" I would then send an array containing all the $member_id (s) and all the entries into the txt fields first... am I correct in that? second ... is the indexing order known and guaranteed? in other words is $data[0] and $data[1] OR $data[12] and $data[13] ALWAYS going to represent a "matched" pair? ( from "one line" of the form } or is the indexing of the array subject to variation and may NOT be in the same order as the [data] fields in the html ? What if nothing is entered into the txt field?I know that enclosing form field names in [] makes them available as an array if the form were dynamically built like PERSONS NAME (from database via $member_id ) next PERSONS NAME (from database via $member_id ) next PERSONS NAME (from database via $member_id ) etc etc I "think" I would then send an array containing all the $member_id (s) and all the entries into the txt fields first... am I correct in that? second ... is the indexing order known and guaranteed? in other words is $data[0] and $data[1] OR $data[12] and $data[13] ALWAYS going to represent a "matched" pair? ( from "one line" of the form } or is the indexing of the array subject to variation and may NOT be in the same order as the [data] fields in the html ? What if nothing is entered into the txt field? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]