Posted by Jerry Stuckle on 08/28/07 08:58
JackpipE wrote:
> hello
>
> Is there any simple method in PHP to create arrays from this database
> table:
>
> NAME | VALUE
> nameA | 10
> nameB | 12
> nameB | 10
> nameB | 10
> nameC | 87
> nameC | 56
> ...
>
> so when I do print_r(nameB) I get:
> nameB => array([0]=12, [1]=10, [2]=10)
>
> thanks,
> Jack
>
Jack,
Are you sure you want a variable called $nameB? Or do you just wan an
array such as $data['nameB']?
Normally it's not a good idea to have variable names dependent on data,
but that's what it looks like you want.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|