mirror of
https://github.com/php/presentations.git
synced 2026-03-24 15:42:33 +01:00
21 lines
400 B
PHP
21 lines
400 B
PHP
<?php
|
|
@exec('rm /tmp/lb.db');
|
|
$db = sqlite_open('/tmp/lb.db', 0666, $sqliteerror);
|
|
|
|
if ($db) {
|
|
|
|
sqlite_query($db, 'CREATE TABLE foo (bar varchar(10))');
|
|
sqlite_query($db, "INSERT INTO foo VALUES ('fnord')");
|
|
|
|
$result = sqlite_query($db,'select bar from foo');
|
|
$record = sqlite_fetch_array($result);
|
|
|
|
echo "<pre>";
|
|
var_dump($record);
|
|
echo "</pre>";
|
|
|
|
} else {
|
|
die ($sqliteerror);
|
|
}
|
|
?>
|