mirror of
https://github.com/dg/dibi.git
synced 2025-07-30 19:00:13 +02:00
examples: files renamed
This commit is contained in:
31
examples/nette-debug-and-exceptions.php
Normal file
31
examples/nette-debug-and-exceptions.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">
|
||||
|
||||
<h1>Nette\Debug & SQL Exceptions | dibi</h1>
|
||||
|
||||
<p>Dibi can display and log exceptions via Nette\Debug, part of Nette Framework.</p>
|
||||
|
||||
<ul>
|
||||
<li>Nette Framework: http://nette.org
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
|
||||
require_once 'Nette/Debug.php';
|
||||
require_once '../dibi/dibi.php';
|
||||
|
||||
|
||||
// enable Nette\Debug
|
||||
Debug::enable();
|
||||
|
||||
|
||||
dibi::connect(array(
|
||||
'driver' => 'sqlite',
|
||||
'database' => 'data/sample.sdb',
|
||||
'profiler' => array(
|
||||
'run' => TRUE,
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
// throws error because SQL is bad
|
||||
dibi::query('SELECT FROM [customers] WHERE [customer_id] < %i', 38);
|
Reference in New Issue
Block a user