List:General Discussion« Previous MessageNext Message »
From:Chris White Date:December 28 2006 6:35pm
Subject:Re: Filling blanks on SELECT
View as plain text  

Ashley M. Kirchner wrote:
>    <?php
>      while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
>        $mins[] = $row['the_minute'];
>        $temp_f[] = $row['avg_temp_f'];
>        $temp_c[] = $row['avg_temp_c'];
>      }
>    ?>

I'd try php here, something like:

<?php
    while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
       $mins[] = empty($row['the_minute']) ? 'blank value' : 
$row['the_minute'];
       $temp_f[] = empty($row['avg_temp_f']) ? 'blank value' : 
$row['avg_temp_f'];
       $temp_c[] = empty($row['avg_temp_c']) ? 'blank value' : 
$row['avg_temp_c'];
    }
?>

Of course, you'd want to replace blank value with whatever a blank 
record is (0, '', etc.).

Thread
Filling blanks on SELECTAshley M. Kirchner28 Dec
  • Re: Filling blanks on SELECTChris White28 Dec
    • Re: [MySQL] Re: Filling blanks on SELECTAshley M. Kirchner28 Dec
      • Re: [MySQL] Re: Filling blanks on SELECTDan Nelson28 Dec
        • Re: [MySQL] Re: Filling blanks on SELECTAshley M. Kirchner28 Dec
        • SQL syntaxScott Yamahata29 Dec
          • Re: SQL syntaxViSolve DB Team29 Dec
          • Re: SQL syntaxViSolve DB Team29 Dec
          • Re: SQL syntaxJoerg Bruehe29 Dec
          • Re: SQL syntaxRhino31 Dec