Jump to content

myITguys

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by myITguys

  1. Im using the values elsewhere as well. But printing them as i pull them would also give me the same problem?
  2. Yes I'm pulling these values out of a mysql database into arrays, to work with the data and then display then.
  3. I have a set of data in 4 arrays Name() Stock() UserID() Price() I can pull the data out of the arrays in a for loop and they are related by a variable $i for ($i=0; $i<count($Name);$i++) { echo $Name[$i] . ' - ' . $Stock[$i] . ' - ' . UserID[$i] . ' - ' . Price[$i]; } This works fine Yahoo - 1000 - 2 - $1.25 Blue - 10000 - 3 - $2.25 Pink - 3000 - 2 - $1.67 Yahoo - 4000 - 5 - $5.00 However If the Name is the same (repeated) i don't want this printed out twice i need the above to look like Yahoo - 1000 - 2 - $1.25 - 4000 - 5 - $5.00 Blue - 10000 - 3 - $2.25 Pink - 3000 - 2 - $1.67 I cant figure out an easy way to do this, by combining arrays, removing duplicates.. Please help... I'm lost at the moment. Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.