{"id":24991461,"url":"https://github.com/4d47/pdo2","last_synced_at":"2026-04-29T17:40:03.190Z","repository":{"id":56938429,"uuid":"14106811","full_name":"4d47/pdo2","owner":"4d47","description":"PDO supplements","archived":false,"fork":false,"pushed_at":"2016-04-11T13:12:16.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-06T05:56:15.655Z","etag":null,"topics":["database","php","wrapper"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4d47.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-04T10:33:44.000Z","updated_at":"2017-11-09T15:44:28.000Z","dependencies_parsed_at":"2022-08-21T06:50:25.052Z","dependency_job_id":null,"html_url":"https://github.com/4d47/pdo2","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/4d47/pdo2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4d47%2Fpdo2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4d47%2Fpdo2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4d47%2Fpdo2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4d47%2Fpdo2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4d47","download_url":"https://codeload.github.com/4d47/pdo2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4d47%2Fpdo2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32437109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T17:34:55.123Z","status":"ssl_error","status_checked_at":"2026-04-29T17:34:45.749Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["database","php","wrapper"],"created_at":"2025-02-04T13:49:07.905Z","updated_at":"2026-04-29T17:40:03.172Z","avatar_url":"https://github.com/4d47.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# PDO2\n\nLightweight (5.6KB) [PDO](http://php.net/pdo) wrapper to accelerate database development.\n\n## Usage\n\n```php\n$db = new PDO2($yourPdoInstance)\n```\n\nAll PDO methods are still available directly,\nbut the instance is augmented with six extra methods.\n\n1. **execute**(string $statement, array $input_parameters = []) : [PDOStatement](http://php.net/manual/en/class.pdostatement.php)\n\n    ```php\n    $stm = $db-\u003eexecute(\"SELECT * FROM wat WHERE id = ?\", [12]);\n    // shortcut of\n    $stm = $this-\u003eprepare(\"SELECT * FROM wat WHERE id = ?\");\n    $stm-\u003eexecute([12]);\n    ```\n\n2. **select**($table, $params = [], $extra = '', $values = []) : [PDOStatement](http://php.net/manual/en/class.pdostatement.php)\n\n    ```php\n    $db-\u003eselect('actors');\n    $db-\u003eselect('actors', ['first_name' =\u003e 'Al']);\n    $db-\u003eselect('actors', ['age \u003e ?' =\u003e 52]);\n    $db-\u003eselect('id,age,name from actors', ['age \u003e ?' =\u003e 52]);\n    // Associative array creates AND, list array creates OR.\n    $db-\u003eselect('actors', ['a' =\u003e 1, [['b' =\u003e 2], ['c' =\u003e 3]]])\n    // SELECT * FROM actors WHERE a = ? AND ((b = ?) OR (c = ?))\n    ```\n\n3. **insert**($table, array $params) : [PDOStatement](http://php.net/manual/en/class.pdostatement.php)\n\n    ```php\n    $db-\u003einsert('actors', ['first_name' =\u003e 'Humphrey', 'last_name' =\u003e 'Bogart', 'age' =\u003e 57]);\n    ```\n\n4. **update**($table, array $params, array $where) : [PDOStatement](http://php.net/manual/en/class.pdostatement.php)\n\n    ```php\n    $db-\u003eupdate('actors', ['first_name' =\u003e 'Tommy'], ['id' =\u003e 3])\n    ```\n\n5. **delete**($table, array $params) : [PDOStatement](http://php.net/manual/en/class.pdostatement.php)\n\n    ```php\n    $db-\u003edelete('actors', ['id' =\u003e 3]);\n    $db-\u003edelete('actors', []); // empty where part cannot be omitted.\n    ```\n\n6. **count**($table, array $params = null) : int\n\n    ```php\n    $db-\u003ecount('actors', ['first_name' =\u003e 'Tom'])\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4d47%2Fpdo2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4d47%2Fpdo2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4d47%2Fpdo2/lists"}