View Single Post
Old 12-30-2007, 07:18 PM   #1 (permalink)
ReSpawN
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default 3 Dimensional Array

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
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote