Variable name (need reply)

my question :

i want to distinguish that this value is for which team (t1 or t2), and it’s id will be inserted in table which table (yellow for yellow cards table and g for goals table).

how to distribute varibale name to know for which table and team is this variable ??.


i have a from for world cup players.
the variables are created automatically using mysql.
this is one of my variables:
$t1_yellow_1 = 24;
this variable means that
t1 –> team number one
yellow –> this player took a yellow card in this match
1 –> counter
24 –> id of player

another example
$t2 –> team 2
g –> this player scored goal(s) in this match
7 –> id of player
2–> counter
4 –> number of goals scored by this player

Can you explain how?

And by the way, I didn’t understand your question.

I mean if the script can be modified by OP :wink:

If creating those variables is in your hand, as guys are suspecting above, change that to arrays rather than the normal variables. Whoever has done the script to create those variables automatically but the approach is not good to manage those data.

They should be created by the script. Otherwise it would mean the database design is a real nightmare :smiley:

Yes, that’s why I’m curious to know how he creates those variable names.

Looks like a good example to use arrays.