I'm aware that Mysql is not preffered for obvious reasons, but It's not my decision to continue using it.
<?php
if (!mysql_select_db('dobhost_databaseexamplename', $con)) {
echo 'Could not select database';
exit;
}
$sql = ("SELECT * FROM sections WHERE recid = '" .$page. "'");
$result = mysql_query($sql, $con);
if (!$result) {
echo "DB Error, could not query the database
";
echo 'MySQL Error: ' . mysql_error();
exit;
}
while ($row = mysql_fetch_assoc($result)) {
?>
<title>Carpets - <?php echo $row['title'];?></title>
<meta name="description" content="<?php echo $row['descr'];?>" />
<meta name="keywords" content="<?php echo $row['keywords'];?>" />
<?php
}
mysql_free_result($result);
?>
this code works fine as an include, its database connection is set up elsewhere but it all works fine, the only issue is that when i include it into the template header, it breaks all the php code below it - Is there any way to isolate my query and php echos so that they won't affect the content below?
Many thanks!