Modified Last: $modified"; function get_news() { // We grab the news out of MySQL, format it, and send it back // to the big index page. $mysql_connect_string = "/home/waskiewicz.org/etc/mysql_connect_string"; $fp = fopen($mysql_connect_string, "r"); $username = fgets($fp, 4096); $password = fgets($fp, 4096); fclose($fp); $username = chop($username); $password = chop($password); $link = mysql_connect("localhost", $username, $password) or die("Could not connect to MySQL!!"); // Select the database mysql_select_db("pj_web", $link); $res = mysql_query("SELECT date,time,body FROM pj_newstable ORDER BY id DESC") or die ("SELECT on pj_newstable died: " . mysql_error()); $return_content = ""; while($row = mysql_fetch_array($res)) { // Need to replace single quotes that were ripped out in the first // place. I need to really centralize all this crap. $date = $row["date"]; $time = $row["time"]; $body = $row["body"]; // Now format everything $return_content = $return_content . "

Posted on $date at $time

\n" . "
$body
\n"; } mysql_close($link); return $return_content; } ?>