Re: $_GET of array variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you very much for all the ideas.

"Printing it out" and the "print_r( $_GET )" of all the incoming variables
did it, along with some caffeine.

In case any future people are interested, the array results from an HTML
form multiple select box like:

        <select name='blight[]' multiple=\"multiple\">
        <option value='unknown'>unknown</option>
        <option value='on trunk'>on trunk</option>
      etc.
        </select>

do in fact come nicely back in PHP 4 in at least one way:

$blight=$_GET['blight'];

(so I didn't need to refer to the specific array keys at all in this part;
$blight is an array)
then I entered it into my linking MySQL table as:

foreach ($blight as $blightid)

        {
        $queryInsertBlightLink=
                "INSERT INTO blightlink
                (treeid, blightid)
                VALUES
                (\"$treeid\",\"$blightid\")";

                $resultInsertBlightLink =
mysql_query($queryInsertBlightLink);
        }

Thanks again!


"Yvonne Federowicz" <Yvonne_Federowicz@xxxxxxxxx> wrote in message
news:20050105174304.21252.qmail@xxxxxxxxxxxxxxx
> Hello,
>
> I am new to PHP 4, and have not been able to find the answer to this
online
> or through experimentation yet.
>
> I have array variables from html forms that I am passing back into the php
> in order to enter into MySQL.  I have had no trouble with simple variables
> using
>
> $_GET['simplevariable']  but am not having much luck with anything like:
>
> $_GET["arrayvariable$a"] (1-dimensional array) or
> $_GET["arrayvariable$a$b"] (2-dimensional array)
>
> (I've tried several other odd syntaxes such as
> $_GET["arrayvariable[$a][$b]"].  Also it's not an \" situation.)
>
> In PHP 3 one can just use the array variables.
> Hopefully a simple syntax thing... Thank you for any ideas!
>
> Yvonne

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux