Jump to content

Putting a persons data into an array


cliftonbazaar

Recommended Posts

So I have two tables (one small, one large), the first table is called 'profile' and has each players name, the second table is called 'toon' and has each players characters.

 

What I am trying to do is output the players (which is easy to do with mysqli_fetch_array) but I also wish to output some of the players toons with their power level.

 

table 'profile'

1  James

2  Darren

 

table 'toons'

1 Batman  456

1 Superman 789

2 Batman 1245

2 Superman 564

 

The output I want is

NAME  BATMAN  SUPERMAN

James  456  789

Darren  1245  564

 

Obviously this is a simplication of what I am doing :)

 

Currently I was looping through all the profiles and then inside each loop calling each row of the toon I wanted but I soon realised that there must be a better way than making 1,500 calls to the database!

 

James

Link to comment
Share on other sites

JOIN is easy if they were the only toons in the database but they are not, in fact they can be out of order for some players

For the benefit of those of us who cannot see your data therefore can not understand your problem, perhaps you should provide a better explanation of the situation and your expected results.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.