Re: 2d array help
| From: | Jim Lucas [php] | Date: | Mon, 21 Jan 2002 22:58:20 +0000 |
| Subject: | Re: 2d array help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81450@lists.php.net to get a copy of this message | ||
$result = mysql_query( "SELECT pkgid FROM plans");
while($row = mysql_fetch_assoc($result))
{
$package = mysql_fetch_assoc(mysql_query( "SELECT * FROM plans WHERE
pkgid='$row[pkgid]'"));
}
obviously this will have
$package = array("key" => "value", ...);
are you wanting to have the above be referanced by the pkgid ?
Jim Lucas
bend.com
----- Original Message -----
From: <kurth@usaexpress.net>
To: <php-general@lists.php.net>
Sent: Monday, January 21, 2002 2:51 PM
Subject: [PHP] 2d array help
> arg- trying to get the data that I pull outta my db into a 2d assoc
array...
>
> any help?
>
> ~kurth
>
> $result = mysql_query( "SELECT pkgid FROM plans");
> while($row = mysql_fetch_assoc($result)){
> $resultpkg = mysql_query( "SELECT * FROM plans WHERE
> pkgid='$row[pkgid]'");
> $package = mysql_fetch_assoc($resultpkg);
> }
>
> print_r($plan);
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>