Last active
August 29, 2015 14:02
-
-
Save lidio601/1c2092c6a956d9074ed0 to your computer and use it in GitHub Desktop.
SQLLite PHP test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# see https://bitbucket.org/lidio601/framework-fabio | |
# PHP Framework derived from Joomla CMS Libraries | |
require_once("framework_fabio.php"); | |
$options = array( | |
'driver' => 'sqllite', | |
'file' => './dbfile.xmf' | |
); | |
$db = _getDBO($options); | |
if ($db) { | |
if( !$db->tableExists('foo') ) { | |
$db->setQuery('CREATE TABLE foo (bar varchar(10))'); | |
$db->query(); | |
} | |
$db->setQuery("INSERT INTO foo VALUES ('fnord')"); | |
$db->query(); | |
$db->setQuery('select bar from foo'); | |
$result = $db->loadObjectList(); | |
print_r($result);; | |
} else { | |
print_r($db); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment