?

Log in

No account? Create an account
entries friends calendar profile It's Me Previous Previous Next Next
The Autobiography of Russell
Life from a different perspective
zimzat
zimzat
~/alive && ~/kicking
All I have to say is allow me to blow your mind away.

$db_query = "
    SELECT `position`, `text` 
    FROM `news` 
    WHERE `entrystartdate` <= '" . date('Y-m-d') . "' AND (
        (
            `entrystartdate` <= '" . $comic . "' AND `entrystopdate` >= '" . $comic . "'
        ) OR (
            `entrystartdate` >= '" . $comic . "' AND `entrystopdate` = '0000-00-00'";
if ($comic_next != '')
{
    $db_query .= " AND `entrystartdate` < '" . $comic_next . "'";
}
$db_query .= "
        )
    ) 
    ORDER BY `publishdate` ASC";


Now that that is done, on to the next thing I need to do. Either a warm soak in the bath tub OR more PDI work. I'm leaning towards the former at the moment so I can relieve some of the tension working on that SQL query caused.

Oh yes, before I go. You'll be able to see the fruits of my labor on the main PDI site later. For now that formula is only on my private server, which Cox disables access to. har har

Current Mood: relieved relieved
Current Music: "Cherish The Day (Antillas Radio Edit)" by Plummet

2 comments or Leave a comment
Comments
sra33 From: sra33 Date: September 4th, 2004 07:03 am (UTC) (Link)
Database Query? For a comic strip. My boyfriend knows more than I do, but that's what that looks like...

~Sammy-Joe
zimzat From: zimzat Date: September 4th, 2004 09:10 am (UTC) (Link)
It is. *nods* It grabs the news related to a specific comic.

The news comes in two flavors: Range or specifc date. Both ways check to make sure the news starts before the current date (in case there are any in the query). When the news is specified as a range it has to make sure the comic date is within the range (after or on start & before stop). When the news is a specific date it has to only get the ones that are on or after today but also before the next comic (if there is one).
2 comments or Leave a comment