Jump to content

[SOLVED] Pulling an array


Kemik

Recommended Posts

Hello all,

 

I'm making a table called "tournament_config". It will have the following:

 

fid = int(11) auto_inc, primary key

clanh = int(11)

clana = int(11)

map = varchar (225)

timestamp = int(11)

 

I want to make a list of maps. E.g. map1, map2, map3, map4. That I can pull from the database and split up. E.g. In week one clans will play map1, in week two clans can play map3.

 

Will I be able to pull that array and break down the maps so I can do this? E.g. $map = $result['map']; Then $map[week1] would = map1.

 

Thanks for your help.

Link to comment
https://forums.phpfreaks.com/topic/63070-solved-pulling-an-array/
Share on other sites

Here's an example.

 

In my table I have inserted:

 

tid: 1

name: My Tournament

max_clans: 32

maps: de_dust, de_dust2, de_aztec, cs_assault, cs_office

Timestamp: 02/08/2007

 

I want to pull "maps" aka "de_dust, de_dust2, de_aztec, cs_assault, cs_office" from my database table and put them in to an array. Then I can use the array and call the maps inside. E.g. $map[week1] = de_dust, $map[week2] = $de_dust2. How do I turn "maps" in to an array?

 

Each tournament might have a different number of maps, otherwise I would have just made a column for each map, instead of calling it maps.

 

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.