Does anyone know how I would fix this code? I am trying to populate my meta tags from a database but I can't seem to get it working properly. Any help would be appricated.
<?php
if (isset($info)){
$subject_set = mysql_query("Select * FROM movies WHERE title like '%".$info."%' and media = '".$med."'", $connection);}
else{
$subject_set = mysql_query("Select * FROM movies", $connection);
}
if (!$subject_set){
die("Database connection failed: " . mysql_error());
}
while ($subject = mysql_fetch_array($subject_set)){
$pgKeywords = $_GET['keywords'];
$pgDesc = $_GET['page_description'];
$tpTitle = $_GET['title'];?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="<?php echo $pgKeywords?>">
<meta name="description" content="<?php echo $pgDesc?>">
<meta name="title" content="<?php echo $tpTitle?> Review on MRZ">
<title><?php echo $tpTitle?> Review on MRZ</title>
<?php } ?>