Nevermind, I figured it out. Simple case of duh...

        $data[] = array('$time' => '$time','$aval' => 'aval');

Should have been:

        $data[] = array('$time' => "$time" ,'$aval' => "aval");

Thanks. :)

-----Original Message-----
From: Eric Boerner [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 12, 2004 9:06 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Trouble with arrays from within MySQL results where
clause

Hello all,

I am having trouble setting array data from within a MySQL results
query. I have modified data from the result and wish to enter it into
it's own array ($data). That then is used to generate a graph. The
following code basically gives me an empty array...

I am pulling out a timestamp and signal strength from a live data stream
to chart how strong a tower's signal is during the day. The data streams
once a minute from several sources. I compare each incoming signal with
the if statement and keep the highest signal strength. Each row is then
put into the new array.

CODE:

$data = array();
while ($row1 = mysql_fetch_row ($queryexe1)){

        $datetime = $row1[2];
        $sig1 = $row1[3]; 
        $sig2 = $row1[6]; 
        $sig3 = $row1[9]; 
        list($date,$time) = explode(" ",$datetime);
        if ($sig1 > "-150") { $aval = "$sig1"; }
        if ($sig2 > "-150") { $bval = "$sig2"; } if ($bval > $aval)
{$aval = bval;}
        if ($sig3 > "-150") { $bval = "$sig3"; } if ($bval > $aval)
{$aval = $bval;}        

        $data[] = array('$time' => '$time','$aval' => 'aval');

        $aval = "-999";

}
$graph->SetDataValues($data);

END CODE:

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to