I actually got this solved by doing the following:
$sql = "select yadda, yadda2, yadda3, UNIX_TIMESTAMP(date) AS date FROM table";
// execute SQL query and get result
$sql_result = mysql_query($sql,$connection)
or die("Couldn't execute query.");
if (!$sql_result) {
echo "<P>Couldn't get item!";
} else {
$csv = fopen("/path/to/file.csv", "w");
while($row = mysql_fetch_array($sql_result))
{
$yadda = $row["yadda"];
$yadda2 = $row["yadda2"];
$yadda3 = $row["yadda3"];
$date_st = date("m/d/Y",$row["date"]);
if($date_st == "12/31/1969") $date_st = "N/A";
fwrite($csv,"$yadda,$yadda2,$yadda3,$date_st\r\n");
}
fclose($csv);
Now granted, this was with the help of other folks on the boards (coding help), but it got the job done. After I wrote the data out to a file, I used the class file someone wrote to allow the mailing of attachments.
I hope this helps some folks on the board with similar problems.
I can't begin to tell you how much help everyone has been. If it weren't for the folks around here, I'd be one lost homie.
Thanx!