If you want to embed code in a list, you'll need to precede it with 8 spacesprecede it with 8 spaces instead of the usual 4:
include/db.php
: <? include_once 'include/config.php';try { $attribs = array( PDO::ATTR_PERSISTENT => $config['db']['persistent'], PDO::ATTR_ERRMODE => $config['db']['errormode'] ); $db = new PDO( $config['db']['uri'], $config['db']['user'], $config['db']['pass'], $attribs ); $db->query("SET NAMES 'utf8'"); $db->query("SET CHARACTER SET 'utf8'"); } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "<br/>"; die(); } function dbGetEngine() { global $config; return substr($config['db']['uri'], 0, strpos($config['db']['uri'], ':')); } ?>
include/config.php
: <?//$config['db']['uri'] = 'sqlite:' . realpath('.') . '/site.db'; // PDO's database access URI $config['db']['uri'] = 'mysql:host=localhost;dbname=sitedb'; // server should be : 195.78.32.7 //$config['db']['uri'] = 'pgsql:host=localhost;dbname=sitedb'; $config['db']['user'] = 'user_goes_here'; // database username $config['db']['pass'] = 'pass_goes_here'; // database password $config['db']['persistent'] = false; // should the connection be persistent $config['db']['errormode'] = PDO::ERRMODE_EXCEPTION; // PDO's error mode ?>