{"id":17767070,"url":"https://github.com/oliverfindl/database-pdo","last_synced_at":"2026-05-05T07:32:40.280Z","repository":{"id":111471676,"uuid":"121056884","full_name":"oliverfindl/database-pdo","owner":"oliverfindl","description":"Simple PHP database class based on PDO class. This class adds 2 new methods - for ping and bulk insert, which are useful for web scrapers. All PDO functionality is preserved.","archived":false,"fork":false,"pushed_at":"2018-07-19T16:44:18.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T14:18:23.343Z","etag":null,"topics":["class","database","pdo","php","php7","wrapper"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oliverfindl.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":"2018-02-10T21:42:30.000Z","updated_at":"2022-02-12T09:00:54.000Z","dependencies_parsed_at":"2023-04-09T07:00:51.237Z","dependency_job_id":null,"html_url":"https://github.com/oliverfindl/database-pdo","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/oliverfindl/database-pdo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fdatabase-pdo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fdatabase-pdo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fdatabase-pdo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fdatabase-pdo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliverfindl","download_url":"https://codeload.github.com/oliverfindl/database-pdo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fdatabase-pdo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32640533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"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":["class","database","pdo","php","php7","wrapper"],"created_at":"2024-10-26T20:42:29.999Z","updated_at":"2026-05-05T07:32:40.264Z","avatar_url":"https://github.com/oliverfindl.png","language":"PHP","funding_links":["https://paypal.me/oliverfindl"],"categories":[],"sub_categories":[],"readme":"# database-pdo\n\n![license](https://img.shields.io/github/license/oliverfindl/database-pdo.svg?style=flat)\n[![paypal](https://img.shields.io/badge/donate-paypal-blue.svg?colorB=0070ba\u0026style=flat)](https://paypal.me/oliverfindl)\n\nSimple [PHP](https://secure.php.net/) database class based on [PDO](https://secure.php.net/manual/en/book.pdo.php) class. This class adds 2 new methods - for ping and bulk insert, which are useful for web scrapers. All [PDO](https://secure.php.net/manual/en/book.pdo.php) functionality is preserved.\n\n---\n\n## Install\n\n```bash\n$ git clone https://github.com/oliverfindl/database-pdo.git\n```\n\n## Usage\n\n* Class initialization is same as for [PDO](https://secure.php.net/manual/en/class.pdo.php) class\n* Ping method doesn't require any argument\n* Insert method has 3 arguments:\n\t* Table (required), into which will be data inserted\n\t* Array (required), which has to be array of associative arrays of data\n\t* Mode (optional):\n\t\t* \\OliverFindl\\Database::INSERT_DEFAULT:  \n\t\t\t```sql\n\t\t\tINSERT INTO table (...) VALUES (...), (...), ... ;\n\t\t\t```\n\t\t* \\OliverFindl\\Database::INSERT_IGNORE:  \n\t\t\t```sql\n\t\t\tINSERT IGNORE INTO table (...) VALUES (...), (...), ... ;\n\t\t\t```\n\t\t* \\OliverFindl\\Database::INSERT_UPDATE:  \n\t\t\t```sql\n\t\t\tINSERT INTO table (...) VALUES (...), (...), ... ON DUPLICATE KEY UPDATE column = VALUES(column), ... ;\n\t\t\t```\n\t\t* \\OliverFindl\\Database::INSERT_REPLACE:  \n\t\t\t```sql\n\t\t\tREPLACE INTO table (...) VALUES (...), (...), ... ;\n\t\t\t```\n\n## Example\n\n```php\nrequire_once(\"./vendor/database-pdo/src/database.class.php\");\n// use \\OliverFindl\\Database; // optional, if you want omit namespace in code\n\ntry {\n\t$db = new \\OliverFindl\\Database(/* ... */); // same arguments as PDO\n\t$db-\u003esetAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_WARNING);\n\t$db-\u003esetAttribute(\\PDO::ATTR_DEFAULT_FETCH_MODE, \\PDO::FETCH_OBJ);\n} catch(\\Exception $e) {\n\texit($e-\u003egetMessage());\n}\n\n// ...\n\ntry {\n\t$db-\u003eping();\n} catch(\\Exception $e) {\n\texit($e-\u003egetMessage());\n}\n\n// ...\n\ntry {\n\t$res = $db-\u003einsert(\"table\", $data, \\OliverFindl\\Database::INSERT_UPDATE);\n\tif($res) $id = $db-\u003elastInsertId();\n} catch(\\Exception $e) {\n\texit($e-\u003egetMessage());\n}\n```\n\n## Requirements\n\n* [PHP 7](https://secure.php.net/manual/en/install.php)\n* [PDO extension](https://secure.php.net/manual/en/pdo.setup.php)\n\n## Notes\n\nThis class is compliant with selected [PDO::ERR_MODE](http://php.net/manual/en/pdo.setattribute.php).\n\n---\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverfindl%2Fdatabase-pdo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverfindl%2Fdatabase-pdo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverfindl%2Fdatabase-pdo/lists"}