Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
<html>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
?>
<?php
// Enter username and password
$username = 'root';
$password = 'root';
// Create database connection using PHP Data Object (PDO)
$db = new PDO("mysql:host=localhost;dbname=baby_cms", $username, $password);
// Identify name of table within database
$table = 'cms_main';
// Create the query - here we grab everything from the table
$q = 'SELECT * from '.$table.' WHERE id = ' . $_GET['id'];
$stmt = $db->query($q);
// Close connection to database
$db = NULL;
$page = $stmt->fetch();
?>
<?php include 'nav.php'; ?>
<h1><?php echo $page['title']; ?></h1>
<div id="body">
<?php echo $page['content'];?>
</div>
</html>