Php framework with sqlite

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

sqlite-database

Here are 30 public repositories matching this topic.

pomf / pomf

Pomf is a simple lightweight file host with support for drop, paste, click and API uploading.

nokonoko / Uguu

Uguu is a simple lightweight temporary file host with support for drop, paste, click and API uploading.

code-architect / Microservices-with-Lumen

A Lumen based microservice ready to deploy with guzzle for consumption of api and OAuth 2

bnomei / kirby3-autoid

Automatic unique ID for Pages, Files and Structures including performant helpers to retrieve them. Bonus: Tiny-URL.

Читайте также:  Change php file upload

CViniciusSDias / curso-php

Repositório com exemplo prático no curso de PHP ministrado por mim

Moxio / sqlite-extended-api

Exposes SQLite APIs that are otherwise not available in PHP

HirotakaDango / ArtCODE

Simple image sharing and upload using PHP with sqlite database.

ByAlperenS / SqlConfig

sydes / sydes

Lightweight CMF for a simple sites with sqlite database

TangChr / php-dynamic-sqlite

Simple PHP library for modifying SQLite dynamically using PDO

gjerokrsteski / pimf-blog-mysql

Simple Blog with PIMF micro framework using MySQL and SQLite database

Prakash4844 / Dressingnity-Ecommerce-Website

This is for Our Dressingnity E-Commerce Site.

dominion-solutions / laravel-mysqlite

A Laravel Service Provider that injects select MySQL functions into SQLite

vishnusharmax / Laravel-5.7-materialize-theme

Laravel latest version 5.7 with Materialize theme setup and sqlite database.

GameMaker2k / Hockey-Test

Just a test script dealing with hockey games and stats.

🔗 This PHP web application uses SQLite as its database and lets you make short links. The program is simple to install and may be used to design unique short links that go to lengthy URLs.

MrKamis / mvc

attogram / sqlite-table-structure-updater

[ARCHIVED] PHP SQLite Table Structure Updater

jayeshmanani / RTIInfo-Portal

This is the complete PHP project with all working. You can find code for login with google, convert inputs to predefined pdf file, saving data of the new users to the database, upload the files to the server and save its path to database, find the files from server and display it in the page, and much more. One can easily download the zip file a…

bishrulhaq / Laravel-5.8-API

Setting up a REST API in Laravel 5.8 using PHPUnit and SQLITE.

Improve this page

Add a description, image, and links to the sqlite-database topic page so that developers can more easily learn about it.

Add this topic to your repo

To associate your repository with the sqlite-database topic, visit your repo’s landing page and select «manage topics.»

Источник

Основы использования SQLite3 в PHP

В этой статье рассмотрим основы SQLite3 для PHP — полезной библиотеки (расширение для PHP), написанной на языке C, которая осуществляет механизм работы с данными с помощью SQL. Фактически, это безтиповая база данных, которая содержится всего в одном файле, который в свою очередь находится в самом проекте (в его файловой системе). Технически в этой базе всё — строки. Мы указываем тип данных для самой библиотеки, чтобы она сама «разруливала» сортировку по числовым полям.

Преимущества и ограничения

  • Полностью бесплатна
  • Нет необходимости в средствах администрирования
  • Высокая производительность и легкая переносимость
  • Поддержка процедурного и объектно-ориентированного интерфейсов
  • Хранение больших объемов данных
  • Хранение строк и бинарных данных неограниченной длины
  • Предназначена для небольших и средних приложений
  • Основной выигрыш в производительности, если преобладают операции вставки и выборки данных
  • При чрезвычайно активном обращении к данным, или в случае частых сортировок, SQLite работает медленнее своих конкурентов

Поддержка SQLite3 в PHP

  • ВPHP 5.0 поддержка SQLite версии 2 была встроена в ядро
  • Начиная с PHP 5.1 поддержка SQLite вынесена за пределы ядра php_sqlite
  • В PHP 5.3 добавлена поддержка SQLite версии 3 php_sqlite3
  • В PHP 5.4 поддержка SQLite версии 2 удалена php_sqlite

Особенности SQLite3

CREATE TABLE users(id INTEGER, name TEXT, age INTEGER)
CREATE TABLE users(id, name, age)

Для задания первичного ключа

id INTEGER PRIMARY KEY id INTEGER PRIMARY KEY AUTOINCREMENT

Экранирование строк через двойной апостроф

Создание, открытие и закрытие базы данных

//Создаём или открываем базу данных test.db $db = new SQLite3("test.db"); //Закрываем базу данных без удаления объекта $db->close(); //Открываем другую базу данных для работы $db->open("another.db"); //Удаляем объект unset($db);

Выполнение запроса

//Экранирование строк $name = $db->escapeString($name); //Для запросов без выборки данных $sql = "INSERT INTO users (name, age) VALUES ('$name', 25)"; //Возвращает значение булева типа $result = $db->exec($sql); //Количество изменённых записей echo $db->changes(); //Отслеживание ошибок echo $db->lastErrorCode(); echo $db->lastErrorMsg();

Подготовленные запросы

$sql = "INSERT INTO users (name, age) VALUES (:name, :age)"; //Готовим запрос $stmt = $db->prepare($sql); //Привязываем параметры $stmt->bindParam(':name',$name); $stmt->bindParam(':age',$age); //Исполняем запрос $result = $stmt->execute(); //Закрываем при необходимости $stmt->close();

Выборка данных

$sql = "SELECT name, age FROM users"; // В случае неудачи возвращает false $result = $db->querySingle($sql); //В $result - значение первого поля первой записи $result = $db->querySingle($sql, true); // В $result - массив значений первой записи // Стандартная выборка $result = $db->query($sql); // Обработка выборки $row = $result->fetchArray(); // SQLITE3_BOTH // Получаем ассоциативный массив $row = $result->fetchArray(SQLITE3_ASSOC); // Получаем индексированный массив $row = $result->fetchArray(SQLITE3_NUM);

Инструменты администрирования БД SQLite

Sqliteman — полезный инструмент для администрирования баз данных SQLite3. Это аналог привычного phpmyadmin для MySql. Программа имеет неплохой графический интерфейс на русском языке, является портативной и не требует установки на ПК. Скачать Sqliteman можно по этой ссылке .

Ещё один популярный менеджер баз данных SQLite — SQLiteStudio

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

PHP framework for SQLite3 databases. A magic way to automatically create objects and persists data at SQLite3 tables.

intrd/sqlite-dbintrd

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

DBIntrd — Simple PHP framework for SQLite3 databases. A magic way to automatically create objects and persists data at SQLite3 tables.

Package intrd/sqlite-dbintrd
Version 2.0
Tags php, sqlite, framework, database
Project URL http://github.com/intrd/sqlite-dbintrd
Author intrd (Danilo Salles) — http://dann.com.br
Copyright (CC-BY-SA-4.0) 2016, intrd
License Creative Commons Attribution-ShareAlike 4.0
Dependencies • php >=5.3.0

System & Composer installation

$ sudo apt-get update & apt-get upgrade $ sudo apt-get install curl php-curl php-cli php-sqlite $ curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer 

Assuming your project are running over Composer PSR-4 defaults, simply Require it on your composer.json

$ composer install -o #to install $ composer update -o #to update Always use -o to rebuild autoload. 

Now Composer Autoload will instance the class and you are able to use by this way..

require __DIR__ . '/vendor/autoload.php'; use database\dbintrd as db; $root=dirname(__FILE__)."/"; $db_path=$root.'vendor/intrd/sqlite-dbintrd/data/sample.dat'; //path of SQLite sample.dat (sample database included) $debug=true; //enable SQL queries debug /* * GET all data from table=users */ $users = new db("users","all"); var_dump($users); //print data /* * GET all data from table=orders + CHILDS data */ $users = new db("orders","all",true); var_dump($users); //print data /* * GET from tables=users, object where SET a different email and UPDATE */ $user = new db("users",40); $user->->email="newmail@dann.com.br"; var_dump($user); $user->save(true); /* * CREATE a fresh new object where table=users, SET a email and password and INSERT */ $user = new db("users"); $user->email="another@dann.com.br"; $user->password="123"; var_dump($user); $user->save(); /* * GET a object from table=users filtering where email=another@dann.com.br */ $users = new db("users","filter:email|another@dann.com.br"); var_dump($users); /* * GET a object from table=users w/ combined filtering (following SQLite sintax) */ $users = new db("users","filter:email='another@dann.com.br' and email='asd@dann.com.br'"); var_dump($users); //print data /* * GET a object from table=orders filtering and returning CHILDS */ $orders = new db("orders","filter:qty|11",TRUE); var_dump($orders); /** * FULL CUSTOM SELECT (following SQLite sintax) */ $users = new db("users","custom:SELECT users.email FROM users WHERE viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true">
  • SELECTS are propagating to Childs at application side, do the same at SQLite side w/ a single JOIN query to return child array objects (look src/classes.php nearby line 123)

About

PHP framework for SQLite3 databases. A magic way to automatically create objects and persists data at SQLite3 tables.

Источник

Оцените статью