Welcome Guest, Not a member yet? Register   Sign In
Creating an associative array through database query
#1

[eluser]theknight[/eluser]
Code:
//for each put all the associated with that child into an array
            foreach($details as $items)
            {
            
               // $ItemsList[] = $items['Name'];
                $ItemsList = array($items['Name'] => $items['NumberNeeded'],);
                
            }
            
       //put all the items into a string
            foreach($ItemsList as $list){  
                       $body .= $list."\n";
                                
                    }

Each item has a quantity, I want to associate each item with it's quantity and put it inside of a string, so that I can use that string within a mail function.

How do I do this? I can get this to work for a single list.

Thanks


Messages In This Thread
Creating an associative array through database query - by El Forum - 07-28-2011, 08:39 AM
Creating an associative array through database query - by El Forum - 07-29-2011, 09:53 AM
Creating an associative array through database query - by El Forum - 07-29-2011, 01:32 PM
Creating an associative array through database query - by El Forum - 07-30-2011, 02:20 AM
Creating an associative array through database query - by El Forum - 07-30-2011, 02:40 AM
Creating an associative array through database query - by El Forum - 07-30-2011, 04:36 AM
Creating an associative array through database query - by El Forum - 07-30-2011, 05:58 AM
Creating an associative array through database query - by El Forum - 07-30-2011, 06:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB