I'm really a beginner when it comes to sqlite. I've only accomplished what I have now with allot of help from a friend. Let me first show you how I query my database and then I'll explain what I want to do. On my page it has the option to show a date selected and return the results (below).
PHP Code:
$db = sqlite_open("load_db");
$q = "SELECT *
FROM serverload
WHERE year='$year'
AND month='$month'
AND date='$date' ";
And another option to show the entire month with a total count (below).
PHP Code:
$q = "SELECT COUNT(*) as total_count
FROM serverload
WHERE year='$year'
AND month='$month'";
What I'm wanting to do is return the most recent 7 days and get the total count. No matter what I've tried works. Can somebody show me how to do this?
Thank you!