Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Last active September 12, 2020 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BMU-Verlag/4fa123e876f36d5d7562e49ca3f49ac0 to your computer and use it in GitHub Desktop.
Save BMU-Verlag/4fa123e876f36d5d7562e49ca3f49ac0 to your computer and use it in GitHub Desktop.
<?php
$sql ="SELECT c_title, c_description, c_headline, c_content FROM os_content WHERE c_id = 3;";
try
{
$dbh = new PDO ("mysql:dbname=onlineshopDB; host=localhost", "user1", "abc");
$return = $dbh->query($sql);
$result = $return->fetchAll(PDO::FETCH_ASSOC);
$meta_title = $result[0]['c_title'];
$meta_description = $result[0]['c_description'];
$main_heading = $result[0]['c_headline'];
$page_content = $result[0]['c_content'];
$dbh = null;
}
catch(PDOException $e)
{
print $e->getMessage();
}
?>
<html>
<head>
<title><?php print $meta_title; ?></title>
<meta name="description" content=<?php print $meta_description; ?>>
</head>
<body>
<h1><?php print $main_heading; ?></h1>
<?php print $page_content; ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment