{"id":19984255,"url":"https://github.com/son-link/tinysqlite","last_synced_at":"2026-06-07T02:32:00.887Z","repository":{"id":139893968,"uuid":"165675199","full_name":"son-link/TinySQLite","owner":"son-link","description":"A tiny php class for work with SQLite3 datatables using PDO.","archived":false,"fork":false,"pushed_at":"2019-01-14T22:25:15.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T20:17:33.508Z","etag":null,"topics":["php","php-class","php-pdo","sqlite3"],"latest_commit_sha":null,"homepage":"https://son-link.github.io/TinySQLite/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/son-link.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-14T14:26:03.000Z","updated_at":"2024-12-13T20:20:48.000Z","dependencies_parsed_at":"2025-12-04T16:03:25.883Z","dependency_job_id":null,"html_url":"https://github.com/son-link/TinySQLite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/son-link/TinySQLite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/son-link%2FTinySQLite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/son-link%2FTinySQLite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/son-link%2FTinySQLite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/son-link%2FTinySQLite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/son-link","download_url":"https://codeload.github.com/son-link/TinySQLite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/son-link%2FTinySQLite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34006056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","php-class","php-pdo","sqlite3"],"created_at":"2024-11-13T04:18:08.161Z","updated_at":"2026-06-07T02:32:00.867Z","avatar_url":"https://github.com/son-link.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TinySQLite\n\nA tiny PHP class for use SQLite3 databases\n\n(c) 2019 Alfonso Saavedra \"Son Link\"\n\nhttp://son-link.github.io\n\nUnder the GNU/GPL 3 or newer license\n\n### Install:\n\nDownload tinysqlite.php and include on your project:\n\n`require_once 'tinysqlite.php'`\n\n### Initialization\n\nCreate a new class instance and pass the file name contains the SQLite3 database:\n\n```php\n$db = new TinySQLite('file')\n```\n\n### Public variables:\n\n* $num_rows (int): Contain the num rows affected by SELECT.\n* $errorInfo (array): Contain ifo if have any error.\n* $lastInsertId (int): Contain the last insertion ID after last INSERT.\n* $result (array): Contain the result of the last query.\n\n### Functions:\n\n#### query:\n\nExecute any SQL sentence:\n```php\n$db-\u003equery($sql, $values=array()):\n```\n**Params:**\n\n* $sql (string, required): is the SQL sentence.\n* $values (array): Array with values to pass to the sentence.\n\n**Returns:** Boolean indicate if the query is executed correctly\n\n##### Example:\n\n```php\n$db-\u003equery('SELECT * FROM table');\n$db-\u003equery('SELECT * FROM table WHERE id=?', 1);\n\n// Obtein the result for a SELECT\n$db-\u003eresult;\n// Or the last insert ID if the table contains a AUTO INCREMENT column:\n$db-\u003e$lastInsertId\n```\n\n#### select:\n\nExecute a SELECT sentence:\n```php\n$db-\u003eselect($params=array()):\n```\n**Params:**\n\n* $params (array, required): A associative array with the parameters to use:\n\t- table (string, required): the name of the table to get the result\n\t- fields (array): A array with the fields to get (by default is all (\\*))\n\t- conditions (array or string): array or string with conditions. The array always use the AND operator, if you can use other operators or JOINS, etc, pass as string.\n\t- orderby (string): order the result using ORDER BY.\n\t- limit (int): the limit of results to return\n\n\n**Returns:** associative array with the result or false if the query fails\n\n##### Example:\n\n```php\n// Get all users\n$result = $db-\u003eselect(array('table' =\u003e 'users'));\n\n// Get only the user with a specific username\n$result = $db-\u003eselect(\n\tarray('\n\t\t'table' =\u003e 'users',\n\t\t'conditions' =\u003e array ('username' =\u003e 'son-link')\n\t')\n);\n\n// Get all users order by username\n$result = $db-\u003eselect(\n\tarray('\n\t\t'table' =\u003e 'users',\n\t\t'orderby' =\u003e 'username ASC'\n\t')\n);\n```\n\n#### insert:\n\nInsert new row on the database\n\n```php\n$db-\u003einsert($table, $values):\n```\n**Params:**\n\n* $table (string, required): The table to insert the new row.\n* $values (array): Associative array with the values.\n\n**Returns:** A int value with the last insert id (if the table contains a PRIMARY KEY with AUTO_INCREMENT) or false if the query fails.\n\n##### Example:\n\n```php\n$insert = $db-\u003einsert('users', array(\n\t'username' =\u003e 'son-link',\n\t'passwd' =\u003e 12345,\n\t'email' =\u003e 'son-link@myhost.com'\n));\n```\n\n#### update:\n\nUpdate row(s)\n\n```php\n$db-\u003eupdate($table, $values, $conditions=''):\n```\n**Params:**\n\n* $table (string, required): is affected table.\n* $values (array, required): Associative array with values to update.\n* $conditions (array): Associative array with the conditions to update\n\n**Returns:** Boolean indicate if the update is executed correctly\n\n##### Example:\n\n```php\n$update = $db-\u003eupdate(\n\t'users',\n\tarray('email' =\u003e 'son-link@example.com'),\n\tarray('id' =\u003e 1)\n);\n```\n\n#### delete:\n\nDelete row(s)\n\n```php\n$db-\u003edelete($table, $conditions, $limit=''):\n```\n**Params:**\n\n* $table (string, required): is the affected table.\n* $conditions (array, required): Associative array with the conditions to delete a row.\n* $limit (int): A limit if affected a more than one row.\n\n**Returns:** Boolean indicate if the delete is executed correctly\n\n##### Example:\n\n```php\n$delete = $db-\u003edelete(\n\t'users', array('user' =\u003e 'son-link'),\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fson-link%2Ftinysqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fson-link%2Ftinysqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fson-link%2Ftinysqlite/lists"}