I am some what new to php or at least to programing, so I need some guidence. I am querying a database with several fields and transfering the information to and array. I am transfering the information to an array, so I can display like this:
Product A vendor A vendor B vendor C vendor D
model A price A price B price C price D
model B price A price B price C price D
etc
Product B vendor A vendor B vendor C vendor D
model A price A price B price C price D
model B price A price B price C price D
My problem is I have too many vendors across the screen and I would like to display the information like:
Product A vendor A vendor B vendor C vendor D
model A price A price B price C price D
model B price A price B price C price D
Product A vendor E vendor F vendor G vendor H
model A price E price F price G price H
model B price E price F price G price H
etc...
Here is how I fill my array and what my CURRENT array looks like:
<?php do {
$dtlCost[$row_costs['product']][$row_costs['model']][$row_costs['vendor']]]=$row_costs['price'];
} while ($row_costs = mysql_fetch_assoc($costs)); ?>
I figure I need nested do/while loops with vendor as my inter most do/while. I need to be able to change the model then scroll through the vendors and display their prices. Once all of the models have been displayed change the product, and repeat the scrolling through the models and vendors again.
Are there any suggestions? or Pointing in the right direction?
Thanks in advance,
James