Hey guys,
I've been trying to figure out something for quite some time now. Decided to give it a try.
PHP Code:
$result = query('SELECT * FROM user_data WHERE user_id = "2"');
$b03tz = mysql_fetch_array($result);
$result2 = query('SELECT * FROM user_data WHERE user_id = "3"');
$respawn = mysql_fetch_array($result2);
$globals = array();
foreach ($respawn as $key => $value) {
array_push($globals, $respawn2[$key]);
}
foreach ($b03tz as $key => $value) {
array_push($globals, $b03tz[$key]);
}
In plain man terms, it's shows a list with some data.
What do I want to do?
We have 2 arrays in an array. The one exports ReSpawN's stats, and the other exports b03tz's. In $global, I've pushed $respawn row results and $b03tz row results.
Now the question is, how do I make them show up in a list like so:
echo $global[$respawn[1]]; or something like that. It's completely new to me so I haven't got a clue what to do.
I also want to GENERATE the difference. When my level of, lets say, a building, is higher than that of b03tz, it shows the difference. For example:
ReSpawN 1
b03tz 0
Difference 1
Mine of course, is green, and b03tz's is red.
Can one of you guys help me out here?
Mark