Okay, do the following as it will tell you your exact problem. Follow the steps exactly!!
1.) Kick your computer!! j/k
REAL 1.) Take your original code (shown below) and change to what was suggested above (shown below)
/**
** ORGINAL CODE
**/
if ($op = 'home') {
$templatesql = "SELECT * FROM template_files WHERE name='home'";
$templatequery = mysql_query(templatesql);
$arr = mysql_fetch_array($templatequery);
$body = $arr['content'];
echo nl2br($body);
} else if ($op = 'av_view') {
$templatesql = "SELECT * FROM template_files WHERE name='av_view'";
$templatequery = mysql_query(templatesql);
$arr = mysql_fetch_array($templatequery);
$body = $arr['content'];
echo nl2br($body);
} else {
$templatesql = "SELECT * FROM template_files WHERE name='home'";
$templatequery = mysql_query(templatesql);
$arr = mysql_fetch_array($templatequery);
$body = $arr['content'];
echo nl2br($body);
}
/**********************/
/**
** MODIFIED CODE
**/
$name = (isset($_GET['op']))?$_GET['op']:'home';
// We'll use a form of query that is a little more secure ;)
$query = sprintf("SELECT * FROM template_files WHERE name='%s'",
mysql_real_escape_string($name));
$result = mysql_query($query);
if(!$result)
$arr = array('content' => 'There was an error with your query. mySQL returned the following:<br>[' . mysql_errno() . '] ' . mysql_error());
else
{
$arr = mysql_fetch_assoc($result);
}
echo nl2br($arr['content']);
2.) Now browse to your page.
3.) If an error shows up, copy & paste it here.
4.) Browse over to google, input this search term (if an error is returned): mySQL error ###
NOTE: the ### will be replaced with the number in the brackets which is the mySQL error code number.
5.) See if anything turns up in google which pertains to your problem.
6.) Post back here if you solve your own issue 😉