Last active
September 12, 2020 08:11
-
-
Save BMU-Verlag/4fa123e876f36d5d7562e49ca3f49ac0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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