示例#1
0
 public function __construct($handle = null)
 {
     $this->connection = $handle;
     $this->query = $this->result = null;
     $this->parameters = array();
     //$this->numberRecords = 0; // probably no longer needed
     $this->fields = array();
     $this->fieldNames = array();
     $this->primaryKeys = array();
     $this->foreignKeys = array();
     $this->reverseForeignKeys = null;
     $this->logFile = null;
     $this->schema = null;
     dbFacile::$instance = $this;
     // construct new dbFacile::$instances element using host and database name?
 }
示例#2
0
<?php

require '../pm-config.php';
include 'dbFacile.php';
$db = dbFacile::open($conf['db']['type'], $conf['db']['name'], $conf['db']['user'], $conf['db']['password'], $conf['db']['host']);
//echo 'SELECT * FROM Panels where ID='.$_GET['panelid'];
$panel = $db->fetchRow('SELECT * FROM Panels where ID=' . $_GET['panelid']);
echo json_encode($panel);
$db->close();
示例#3
0
<?php

include 'php/dbFacile.php';
$db = dbFacile::open('mysql', 'panel-manager', 'root', 'root', 'localhost');
$id = $db->insert(array('title' => 'New Coordinators', 'subtitle' => 'Congratulations to Shawndra Hall and Lisa Frank', 'photourl' => 'http://www.fwyam.org/images/featured/hallfrank.jpg', 'photoalt' => 'Lisa and Shawndra', 'linkurl' => 'http://www.fwyam.org/2009/08/new-coordinators-team-leaders/', 'bannercolor' => 'red'), 'Panels');
$id = $db->insert(array('title' => 'Theology on Tap Tuesdays in September', 'subtitle' => 'Buffalo Wild Wings in South Hulen', 'photourl' => 'http://www.fwyam.org/images/featured/content16.jpg', 'photoalt' => 'Theology on Tap', 'linkurl' => 'http://www.fwyam.org/teams/theology-on-tap/fort-worth/', 'bannercolor' => 'blue'), 'Panels');
$id = $db->insert(array('title' => 'Young Adult Retreat October 10', 'subtitle' => 'Strength for the Journey One Day Retreat', 'photourl' => 'http://www.fwyam.org/images/featured/retreat.jpg', 'photoalt' => 'Retreat', 'linkurl' => 'http://www.fwyam.org/teams/retreats/', 'bannercolor' => 'orange'), 'Panels');
$id = $db->insert(array('title' => 'Flag Football November 7', 'subtitle' => 'Annual Charity Event at St. Andrews', 'photourl' => 'http://www.fwyam.org/images/featured/football.jpg', 'photoalt' => 'Flag Football', 'linkurl' => 'http://www.fwyam.org/teams/athletics/flag-football/', 'bannercolor' => 'blue'), 'Panels');
示例#4
0
文件: index2.php 项目: rctay/dbFacile
<?php

// this file is for testing non-query operations
error_reporting(E_ALL);
include '../dbFacile.php';
// does it pull the schema properly
$db = dbFacile::open('sqlite', 'ecommerce.db');
$db->logToFile('db2.log');
$db->cacheSchemaToFile('schema.cache.php');
// does the schema include primary keys
// does the schema include foreign keys
// does dbFacile correctly utilize a dbHandle?
var_dump($db->schema);
示例#5
0
 function __construct($handle = null)
 {
     parent::__construct();
     $this->addQuotes = false;
     $this->schemaNameField = 'name';
     $this->schemaTypeField = 'type';
     if ($handle != null) {
         $this->connection = $handle;
     }
 }
示例#6
0
<?php

error_reporting(E_ALL);
include '../dbFacile.php';
$db = dbFacile::open('sqlite3', 'testing.sqlite3.db');
$db->logToFile('db.log');
//$create = true;
$create = false;
if ($create) {
    //$db->execute('create table test (b integer auto_increment, c text, primary key(b))');
    echo $db->insert(array('c' => 'aaa'), 'test') . '<br />';
    echo $db->insert(array('c' => 'bbb'), 'test') . '<br />';
    echo $db->insert(array('c' => 'ccc'), 'test') . '<br />';
    // begin support for multi-field primary keys
    echo $db->insert(array('id' => '1', 'name' => 'Hello'), 'test2') . '<br />';
    exit;
} else {
    $db->buildSchema();
}
echo 'fetch (select * from test)<br />';
$rows = $db->fetchAll('select * from test');
var_dump($rows);
echo '<br /><br />fetch with ? (select * from test where b > 1)<br />';
$rows = $db->fetchAll('select * from test where b > ?', array('1'));
var_dump($rows);
// tests name parameter substring squashing
echo '<br /><br />fetch with name params (select * from test where b = 1 or b = 2)<br />';
$rows = $db->fetchAll('select * from test where b = :aa or b = :aab', array('aa' => '1', 'aab' => 2));
var_dump($rows);
echo '<br /><br />fetchRow (select * from test where be = 1)<br />';
$row = $db->fetchRow('select * from test where b = ?', array('1'));
示例#7
0
文件: index.php 项目: rctay/dbFacile
<?php

error_reporting(E_ALL);
include '../dbFacile.php';
$db = dbFacile::open('sqlite', 'testing.db');
$db->logToFile('db.log');
//$create = true;
$create = false;
if ($create) {
    //$db->execute('create table test (b integer auto_increment, c text, primary key(b))');
    echo $db->insert(array('c' => 'aaa'), 'test') . '<br />';
    echo $db->insert(array('c' => 'bbb'), 'test') . '<br />';
    echo $db->insert(array('c' => 'ccc'), 'test') . '<br />';
    // begin support for multi-field primary keys
    echo $db->insert(array('id' => '1', 'name' => 'Hello'), 'test2') . '<br />';
    exit;
} else {
    $db->buildSchema();
}
echo 'fetch (select * from test)<br />';
$rows = $db->fetchAll('select * from test');
var_dump($rows);
echo '<br /><br />fetch with ? (select * from test where b > 1)<br />';
$rows = $db->fetchAll('select * from test where b > ?', array('1'));
var_dump($rows);
// tests name parameter substring squashing
echo '<br /><br />fetch with name params (select * from test where b = 1 or b = 2)<br />';
$rows = $db->fetchAll('select * from test where b = :aa or b = :aab', array('aa' => '1', 'aab' => 2));
var_dump($rows);
echo '<br /><br />fetchRow (select * from test where be = 1)<br />';
$row = $db->fetchRow('select * from test where b = ?', array('1'));