I have run into an ODBC bug, where the driver is not properly filtering out records with NULL values in the WHERE clause. Since I cannot, yet update to a newer version of ODBC which I'm sure corrects this bug (we are using ODBC 1.5), I would like to use PHP as a work around to remove the records with NULL values in the particular field. What would be the easiest way to do this?

Best regards,

Bruce

    well, really the only way I can think of is to add an if() statement at the point where you actually iterate through the rows. like this:

    while($thisRow = mysql_fetch_array($myResult)) {
    if($thisRow["testColumn"] != null) {
    ...
    (work here)
    ...
    }
    }

    since PHP doesn't generally retrieve the entire result-set as a PHP variable type (only individual rows), attempting to remove rows from a result-set would be unnecessarily tedious and could introduce other complications. I think the above workaround is your best option.

      Write a Reply...