[nycphp-talk] T_ARRAY error but have no idea why
Phil Powell
soazine at erols.com
Tue Sep 23 22:15:51 EDT 2003
Yep couldn't figure out the exact syntax of what I wanted, thanx!
Phil
----- Original Message -----
From: "Andrew Yochum" <andrew at digitalpulp.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Tuesday, September 23, 2003 11:25 AM
Subject: Re: [nycphp-talk] T_ARRAY error but have no idea why
> Perhaps you want...
> ${$label . 'Array'} = array();
> or something similar?
>
> On Mon, Sep 22, 2003 at 07:16:23PM -0400, Phil Powell wrote:
> > The following code:
> >
> > $kounter = 0; $fsArray = array('farge', 'storrelse');
> > for ($i = 0; $i < sizeof($fsArray); $i++) {
> > // POPULATE CONTENT FOR BOTH FARGE AND ST?RRELSE DROPDOWNS NOW
ASSOCIATED ACCORDING TO PRODUKT ID
> > $label = $fsArray[$i];
> > ${$label}Array = array();
> > $sql = 'SELECT s.nnet_produkt_' . $label . '_navn ' .
> > 'FROM nnet_produkt p, nnet_produkt_' . $label . '_assoc q, '
.
> > ' nnet_produkt_' . $label . ' r ' .
> > 'WHERE p.nnet_produkt_id = q.nnet_produkt_id ' .
> > ' AND p.nnet_produkt_id = ' . $row['nnet_produkt_id'] .
> > ' AND q.nnet_produkt_' . $label . '_id = r.nnet_produkt_' .
$label . '_id';
> > $dropdownQuery = mysql_query($sql) or die('Could not perform
dropdown query: ' . mysql_error());
> > while ($dropdownRow = mysql_fetch_row($dropdownQuery))
> > array_push(${$label}Array, $dropdownRow[0]);
> > } // END OF FOR LOOP FOR $fsArray
> >
> > produces the following error:
> >
> > Parse error: parse error, unexpected T_ARRAY in
/home/nordicnet.no/membersites/vis_varegruppen.php on line 133
> >
> > Line 133 is:
> >
> > ${$label}Array = array();
> >
> > I'm lost as usual. Help!
> >
> > Thanx
> > Phil
> > _______________________________________________
> > talk mailing list
> > talk at lists.nyphp.org
> > http://lists.nyphp.org/mailman/listinfo/talk
>
>
> --
> Andrew Yochum
> Digital Pulp, Inc.
> 212.679.0676x255
> andrew at digitalpulp.com
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
More information about the talk
mailing list