I'm not sure if this is a PHP bug or a MySQL bug or what, but here goes:
Script:
$timenow = time();
$red = ($timenow-345600);
$ticket_query = mysql_query("SELECT * FROM opentickets WHERE AskDate < '$red'");
This query returns all tickets where AskDate is earlier than the $red date, PLUS all tickets above 1 billion on the time stamp! Ack! I have resolved this by removing the single quotes from around '$red' in my query, so it reads:
$ticket_query = mysql_query("SELECT * FROM opentickets WHERE AskDate < $red");
Just thought I would share this.