Sorry if this is a dumb question as the last time I've coded was a year ago.
I have this:
<?php
function connectdb() {
mysql_connect("xxxxx", "xxxx", "");
}
if ($var="view") {
connectdb();
mysql_select_db("xnews");
$sql = "select author, title, body, picture, weekday, day, month, year, time from news";
$r = mysql_query($sql);
include "class.fasttemplate.pinc";
$tpl = new FastTemplate(".");
while ($row = mysql_fetch_array($r)) {
$tpl->define(array("main" => "main.tpl"));
$tpl->assign(array("AUTHOR" => $row['author'],
"TITLE" => $row['title'],
"BODY" => $row['body'],
"PICTURE" => $row['picture'],
"WEEKDAY" => $row['weekday'],
"DAY" => $row['day'],
"MONTH" => $row['month'],
"YEAR" => $row['year'],
"TIME" => $row['time']));
$tpl->parse("GLOBAL", "main");
$tpl->FastPrint();
}
echo("BLASHPEMY!");
}
?>
It connects to the db fine and sets all the variables properly. Then it gives me a "nothing parsed, nothing printed" error
Anyone?