$db = new SQLite3("test.db");
$sql = "CREATE TABLE tbl1(
id INTEGER PRIMARY KEY,
c1 TEXT,
c2 TEXT
);";
$db->exec($sql);
$sql = "INSERT INTO tbl1
(1, 'aaaa', 'bbbbb'),
(2, 'xxx', 'yyy');";
$db->exec($sql);
$sql = "SELECT * FROM tbl1 ;";
$result = $db->query($sql);
while ($row = $result->fetchArray(SQLITE3_NUM)) {
$array[] = $row;
}
print json_encode($array);
$db = new SQLite3("test.db");
$sql = "CREATE TABLE tbl1(
id INTEGER PRIMARY KEY,
c1 TEXT,
c2 TEXT
);";
$db->exec($sql);
$sql = "INSERT INTO tbl1(col1, col2) VALUES
('aaaa', 'bbbbb'),
('xxx', 'yyy');";
$db->exec($sql);
$sql = "SELECT * FROM tbl1 ;";
$result = $db->query($sql);
while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
$array[] = $row;
}
print json_encode($array);
[{"id":1,"c1":"aaaa","c2":"bbbbb"}]
$db = new SQLite3("test.db");
$sql = "CREATE TABLE tbl1(
id INTEGER PRIMARY KEY,
c1 TEXT,
c2 TEXT
);";
$db->exec($sql);
$sql = "INSERT INTO таблица1(col1, col2) VALUES
('aaaa', 'bbbbb'),
('xxx', 'yyy');";
$db->exec($sql);
$sql = "SELECT * FROM tbl1 ;";
$result = $db->query($sql);
$array = $result->fetchArray(SQLITE3_NUM);
print json_encode($array);
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAMAAAAOusbgAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEz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