Jump to content

Table joining


Lv-Kris

Recommended Posts

Ok, hers the situation:

Here are some of mine tables: user data, user_weapons, game_weapons

The idea is to store only the weapon_id and amount of those user has in the user_weapons table. Then its linked to game_weapons, where we get weapon details from.

Well i need a little help on joining them all together...

For example user attacks other user with his weapon, he chooses the weapon id and the amount of damage depends on the weapon stats stored in game_weapons table.

I am willing to do this because of easier modifying later ;D Hope You got the idea.

Kris

Link to comment
https://forums.phpfreaks.com/topic/44208-table-joining/
Share on other sites

that measn you have more than one row as a result and each row is an array, you have to make a loop  to echo each row

 


for ($i = 0; $i < mysql_num_rows($result); $i++)
{
$row[$i] = mysql_fetch_assoc($result);
print_r($row[$i]);
}

 

result being the result of your query (wich is what gives you Resource id #29)

Link to comment
https://forums.phpfreaks.com/topic/44208-table-joining/#findComment-218063
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.