Hi, need someone with a fresh mind on tacking this problem. I haven't
gotten this to work right for 1 1/2 days now.
In the sample script, you will noticed that the php variable, '$ODBC_RESULT'
represent a year in 4 digit, like 2003, 2002, 2001, 2000, etc... When I
grab the data from the database and put it into a loop, the only thing I
need to do is to have PHP spit out the javascript code if the year is a
first time use and have PHP not to spit out the javascript code if the same
year is being repeated... Just like that.
I don't know what I am doing wrong. I did declare the $ArrayDataCount
before the start of the loop. This sample code is inside the loop.
--clip--
$ODBC_RESULT = trim(odbc_result($result,2));
$ArrayCheck = $ArrayDataCount['$ODBC_RESULT'];
$ArrayCheck += 0;
if (strlen(trim($ArrayCheck)) == 0) {
$ArrayCheck = 0;
} else {
$ArrayCheck = $ArrayDataCount['$ODBC_RESULT'];
}
if ($ArrayCheck == 0) {
$ArrayDataCount['$ODBC_RESULT'] = "0";
} else {
$ArrayCheck++;
$ArrayDataCount['$ODBC_RESULT'] = $ArrayCheck;
}
if ($ArrayCheck == 0) {
echo " jsTimeRange['".trim(odbc_result($result,2))."'] = new
Array(new Array(),new Array());\n";
}
--clip--
Thanks!
Scott
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php