Added DB Access + Error page
This commit is contained in:
@@ -37,10 +37,23 @@ return array(
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
'db' => array(
|
||||
'connectionString' => 'mysql:host=localhost;dbname=db451718',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'enableProfiling' => true,
|
||||
'enableParamLogging' => true,
|
||||
'charset' => 'utf8',
|
||||
),
|
||||
),
|
||||
'params' => array(
|
||||
// php configuration
|
||||
'php.defaultCharset' => 'utf-8',
|
||||
'php.timezone' => 'UTC',
|
||||
|
||||
'yii.handleErrors' => true,
|
||||
'yii.debug' => true,
|
||||
'yii.traceLevel' => 3,
|
||||
)
|
||||
);
|
||||
33
app/config/env/dev.php
vendored
33
app/config/env/dev.php
vendored
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author Antonio Ramirez <amigo.cobos@gmail.com>
|
||||
* @link http://www.ramirezcobos.com/
|
||||
* @link http://www.2amigos.us/
|
||||
* @copyright 2013 2amigOS! Consultation Group LLC
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
||||
*/
|
||||
return array(
|
||||
'modules' => array(
|
||||
'gii' => array(
|
||||
'class' => 'system.gii.GiiModule',
|
||||
'password' => 'yii',
|
||||
'ipFilters' => array('127.0.0.1','::1'),
|
||||
),
|
||||
),
|
||||
'components' => array(
|
||||
'db' => array(
|
||||
'connectionString' => 'mysql:host=localhost;dbname=db451718',
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'enableProfiling' => true,
|
||||
'enableParamLogging' => true,
|
||||
'charset' => 'utf8',
|
||||
),
|
||||
),
|
||||
'params' => array(
|
||||
'yii.handleErrors' => true,
|
||||
'yii.debug' => true,
|
||||
'yii.traceLevel' => 3,
|
||||
)
|
||||
);
|
||||
26
app/config/env/prod.php
vendored
26
app/config/env/prod.php
vendored
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author Antonio Ramirez <amigo.cobos@gmail.com>
|
||||
* @link http://www.ramirezcobos.com/
|
||||
* @link http://www.2amigos.us/
|
||||
* @copyright 2013 2amigOS! Consultation Group LLC
|
||||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
|
||||
*/
|
||||
return array(
|
||||
'components' => array(
|
||||
'db' => array(
|
||||
'connectionString' => 'mysql:host=rdbms.strato.de;dbname=DB451718',
|
||||
'username' => 'U451718',
|
||||
'password' => 'Datenbank',
|
||||
'enableProfiling' => YII_DEBUG,
|
||||
'enableParamLogging' => YII_DEBUG,
|
||||
'charset' => 'utf8',
|
||||
),
|
||||
),
|
||||
'params' => array(
|
||||
'yii.debug' => false,
|
||||
'yii.traceLevel' => 0,
|
||||
'yii.handleErrors' => APP_CONFIG_NAME !== 'test',
|
||||
)
|
||||
);
|
||||
7
app/config/env/stage.php
vendored
7
app/config/env/stage.php
vendored
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* stage.php
|
||||
*/
|
||||
|
||||
return array(
|
||||
);
|
||||
@@ -91,16 +91,6 @@
|
||||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.9.1.min.js"><\/script>')</script>
|
||||
<script src="js/libs/bootstrap.min.js"></script>
|
||||
<script src="js/plugins.js"></script>
|
||||
<script src="js/main.js"></script><script>
|
||||
var _gaq = [
|
||||
['_setAccount', 'UA-XXXXX-X'],
|
||||
['_trackPageview']
|
||||
];
|
||||
(function (d, t) {
|
||||
var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
|
||||
g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
|
||||
s.parentNode.insertBefore(g, s)
|
||||
}(document, 'script'));
|
||||
</script>
|
||||
<script src="js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
12
app/views/site/error.php
Normal file
12
app/views/site/error.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
$this->pageTitle=Yii::app()->name . ' - Error';
|
||||
$this->breadcrumbs=array(
|
||||
'Error',
|
||||
);
|
||||
?>
|
||||
|
||||
<h2>Error <?php echo $code; ?></h2>
|
||||
|
||||
<div class="error">
|
||||
<?php echo CHtml::encode($message); ?>
|
||||
</div>
|
||||
@@ -16,9 +16,27 @@
|
||||
<div class="span4">
|
||||
<h2>Heading</h2>
|
||||
|
||||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris
|
||||
condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis
|
||||
euismod. Donec sed odio dui. </p>
|
||||
<p>
|
||||
|
||||
<?php
|
||||
$connection = Yii::app()->db;
|
||||
|
||||
$command=$connection->createCommand("SELECT * FROM programme");
|
||||
$command->execute(); // a non-query SQL statement execution
|
||||
// or execute an SQL query and fetch the result set
|
||||
$reader=$command->query();
|
||||
|
||||
// each $row is an array representing a row of data
|
||||
$dbgtxt = "ello";
|
||||
foreach($reader as $row)
|
||||
{
|
||||
$dbgtxt = $dbgtxt . print_r($row, true);
|
||||
}
|
||||
|
||||
echo TbHtml::textArea('dbgtxt', $dbgtxt, array('rows' => 5));
|
||||
?>
|
||||
|
||||
</p>
|
||||
|
||||
<p><a class="btn" href="#">View details »</a></p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user