In my database I have a couple of fields and I'm trying to create multidimensional arrays out of them.
For example, in my db, I have:
Colors | Price
red,blue,yellow | 50,45,32
yellow,green,purple | 12,47,82
gold | 39
I'd like to build arrays that looks like this:
array('red' =>'50', 'blue' => '45', 'yellow' => '32')
array('yellow' =>'12', 'green' =>'47', =>', 'purple'=>'82')
array('gold' => '39')
Is there a way to do this? I've looked at the array functions in the php manual, but I still don't understand how I can build these from queries to my db.