List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:December 28 2006 6:52pm
Subject:Re: [MySQL] Re: Filling blanks on SELECT
View as plain text  
In the last episode (Dec 28), Ashley M. Kirchner said:
> Chris White wrote:
> >I'd try php here, something like:
>    Problem is, PHP doesn't know which record is blank.  I select for 60 
> records and MySQL returns 55.  How is PHP supposed to know which 5 are 
> blank?

Mysql doesn't know either.  All it's doing is storing numbers.  Is it
possible to pass the timestamp to your graphing program and tell it to
use time as its X-axis (both gnuplot and ploticus can, for example)? 
If plotted as a bar chart with 1-minute-wide bars, missing records will
just be blanks.

If not, you'll probably have to read the records and store them in an
array indexed by minute.  Then when you're done reading from mysql,
walk the array from 0 to 59 and write out each element.  That way
you're guaranteed 60 output rows.

-- 
	Dan Nelson
	dnelson@stripped
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