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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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