Create multidimensional array from sql query and display in

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mazola
Forum Newbie
Posts: 2
Joined: Thu Jul 17, 2008 1:49 pm

Create multidimensional array from sql query and display in

Post by mazola »

Good day
I am fairly new to php and have a problem.
I have two tables in mysql, that is dividendparams and dividendhistorydetails. dividendparams has fields paramid,paramname while dividendhistorydetails has fields detailsid,paramid,year,dividenditem.

I would like to query data from both tables and display as follows;
Year1 Year2 Year3 Year4
Paramname1 Dividenditem1 Dividenditem2 Dividenditem3 Dividenditem4
Paramname2 Dividenditem5 Dividenditem6 Dividenditem7 Dividenditem8
Paramname3 Dividenditem9 Dividenditem10 Dividenditem11 Dividenditem12
Paramname4 Dividenditem13 Dividenditem14 Dividenditem15 Dividenditem16
Paramname5 Dividenditem17 Dividenditem18 Dividenditem19 Dividenditem20

the number of paramname and year can increase, thereby increasing the dividenditem too.

Any help on this will be appreciated.
Thank you
mikosiko
Forum Regular
Posts: 757
Joined: Wed Jan 13, 2010 7:22 pm

Re: Create multidimensional array from sql query and display

Post by mikosiko »

What have you tried so far?

Do you have errors in your code and you need help on those?
Post Reply