Welcome to the Browser-Base Game Zone forums!
The equipment table which contains the name, ID and type of an item.The inventory table contains the user (who owns this item), the itemID and the amount of this item.
$rs = $db->Execute("SELECT player_equipment.player_equipmentid, player_inventory.amount, equipmentlu.name, equipmentlu.typeFROM player_equipment, equipmentluWHERE player_equipment.equipmentid = equipmentlu.equipmentidAND player_equipment.playerid = $playerid");$inventory = "";while( !$rs->EOF ) { $key = $rs->fields['type'] $inventory[$key][] = array("name" => $rs->fields['name'], "amount" => $rs->['amount']); $rs->MoveNext;}
if( isset($inventory['weapon'] && !empty($inventory['weapon'] ) { foreach( $inventory['weapon'] as $w ) { echo $w['name'], ' - ', $w['amount']; }}