Date: 10/13/00
- Next message: Javier Morquecho Morquecho: "RE: [PHP-DB] Some SQL/ODBC admin tool for WIN?"
- Previous message: Tom: "[PHP-DB] php and sybase"
- In reply to: Adv. Systems Design: "[PHP-DB] 2 dim array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Adv. Systems Design" <asd_2000 <email protected>> wrote:
> I am passing a bunch of form values from
> HTTP_POST_VARS to $frm. There are some form values
> which are passed into $frm as an array already (i.e.
> glenum[])...So I am assuming that the array is passed
> into $frm and what I am getting is:
> $frm[name]=Jane Public
> $frm[address]=123 Main St.
> $frm[glenum][1]=Some value
> $frm[glenum][2]=some other value
> ...etc
>
> Is this correct?
Add a phpinfo() at the end of your page. In the output you
can see the HTTP_POST_VARS etc. and the format in which they
are passed to your script.
Or try print_r($frm) to inquire your array.
> The problem I am having is in traversing the
> $frm[glenum][] array and updating the db with those
> values...
>
> I tried this with no luck:
>
> $glearray = $frm["glenum"];
> while (list ($key1) = each ($glearray)) {
> while (list ($key2, $val) = each
> ($glearray["$key1"])) {
> $qid = db_query("
> INSERT INTO lesson_gle (l_id, glenum)
> VALUES ('$id', '$val')
> ");
> }
> }
I do not understand the need of the nested loops, isn't it
this what you want to do?
$glearray = $frm["glenum"];
foreach ($glearray as $val) {
$qid = db_query("INSERT INTO lesson_gle (l_id, glenum)
VALUES ('$id', '$val')");
}
Lutz
-- ibWebAdmin 0.2alpha *** web-based InterBase database administration *** download the latest version from http://home.knuut.de/lb/ ***-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Javier Morquecho Morquecho: "RE: [PHP-DB] Some SQL/ODBC admin tool for WIN?"
- Previous message: Tom: "[PHP-DB] php and sybase"
- In reply to: Adv. Systems Design: "[PHP-DB] 2 dim array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

