PHP MySQL Charts/Graphs

From: ANT_THOMAS 8 May 2013 23:46
To: Matt 40 of 47
A MySQL question.

Due to there being missing parts on the chart for the shorter readings because of the missing entries I've changed how the data is pulled from the database by calculating the current time minus the length of time required then only fetching the rows that are greater than this calculated time. It works nicely and gives a proper day, week length etc.

My question is should I be indexing my "unixtime" column to make it easier on the DB? 

New code is...

code: 
$currtime = time();
$newlimit = $currtime - $limit;
SELECT * FROM outside WHERE unixtime > $newlimit ORDER BY id DESC
With $limit now being the length of time in seconds.
edit: I think that looks better.

EDITED: 8 May 2013 23:48 by ANT_THOMAS
From: ANT_THOMAS 8 May 2013 23:47
To: ALL41 of 47
I suck at using the new editor.
From: Matt 9 May 2013 05:57
To: ANT_THOMAS 42 of 47
Yes, an index would be useful there.
From: af (CAER) 9 May 2013 10:07
To: ANT_THOMAS 43 of 47
The editor sucks at being used, more like.
From: ANT_THOMAS 9 May 2013 10:34
To: Matt 44 of 47
Is it a cache issue that is causing no grey box to appear when I want to add code in the new editor? Only "code:" appears I end up having to go in to the HTML and put things between the pre tags but there's divs all over the place.
From: Matt 9 May 2013 12:17
To: ANT_THOMAS 45 of 47
Could be a cache issue, it's showing here on both "Teh Forum" and "Yellow" themes.
From: Drew (X3N0PH0N)14 May 2013 05:24
To: ALL46 of 47
Another slightly irrelevant cool thing: http://ankane.github.io/chartkick/
From: Isa (IZA_MUSED)17 Dec 2013 17:45
To: ANT_THOMAS 47 of 47
Ant- What a cool/interesting thing to do.
Is your questioned answered?  I imagine so by now, but don't have time to read.