Posted by Steve on 08/28/07 03:19
"JackpipE" <pipe.jack@gmail.com> wrote in message
news:1188270433.059195.109550@50g2000hsm.googlegroups.com...
| 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)
$example = array();
foreach ($records as $record)
{
$example[$record['NAME']][] = $record;
}
print_r($example['nameB']);
[Back to original message]
|