Here is the webpage that demonstrates my code problem:
I'm so close I can smell it. Hoping someone can troubleshoot my code. Here is the 
piece that doesn't work. It returns the 2 column names, over and over. For some reason 
I'm not loading the values from the query. (Using only 2 columns for now and 
hardcoding number of rows):
function QueryIntoArray($query){
 /* connect to sdwis server*/
$connectionSDWIS = odbc_connect("xxxx","xxxx","xxxx");
if(!$connectionSDWIS) die("Couldn't connect");
/* select sdwis database */
odbc_do($connectionSDWIS, "use xxxx");
$result= odbc_do($connectionSDWIS,$query);
                       print "Query Failed";
  for($j=1;$j <$fields;$j++){
                $retval[$i][odbc_field_name($result,$j)] = odbc_result($result,$j);
               }//end inner loop
              }//end outer loop
return $retval;
}//end function
$query = "SELECT DISTINCT PWS, PWSName, CONVERT(varchar(12), DateCollected, 101), 
AnalyteName, SourceID, str(Results,7,4), str(MCL, 7,4), UOM, DateCollected FROM 
ChemMon WHERE PWSID='00100'  AND AnalyteCode NOT IN('3013','3014','3100') ORDER BY 
DateCollected DESC, AnalyteName ";

$myresult = QueryIntoArray($query);
       print $myresult[$i]["AnalyteName"];
       print $myresult[$i]["UOM"];

Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.

Reply via email to