{"id":17222677,"url":"https://github.com/samayo/styrofoam","last_synced_at":"2025-04-14T00:16:34.598Z","repository":{"id":11002107,"uuid":"13325450","full_name":"samayo/styrofoam","owner":"samayo","description":"yet another pdo wrapper","archived":false,"fork":false,"pushed_at":"2019-11-15T22:36:39.000Z","size":83,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T00:16:25.832Z","etag":null,"topics":["crud-application","database-access","pdo","pdo-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/samayo.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}},"created_at":"2013-10-04T13:52:20.000Z","updated_at":"2023-09-08T16:42:34.000Z","dependencies_parsed_at":"2022-09-17T20:52:08.128Z","dependency_job_id":null,"html_url":"https://github.com/samayo/styrofoam","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samayo%2Fstyrofoam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samayo%2Fstyrofoam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samayo%2Fstyrofoam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samayo%2Fstyrofoam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samayo","download_url":"https://codeload.github.com/samayo/styrofoam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799951,"owners_count":21163404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["crud-application","database-access","pdo","pdo-wrapper"],"created_at":"2024-10-15T04:06:05.804Z","updated_at":"2025-04-14T00:16:34.574Z","avatar_url":"https://github.com/samayo.png","language":"PHP","readme":"## Styrofoam\n\nA tiny PDO wrapper class, for simple CRUD operation. \n\nInstall \n-----\nUsing composer\n````bash\n$ composer require samayo/styrofoam:1.0.*\n````\nUsing git\n```bash\n$ git clone https://github.com/samayo/styrofoam.git\n```\n\nUsage\n-----\n\n```php\nrequire 'path/to/styrofoam.php';\n\n$db = new Styrofoam\\Database(\n  'mysql:host=localhost; dbname=db-name;  charset=utf8', 'db-user', 'db-pass', [\n  PDO::ATTR_ERRMODE =\u003e PDO::ERRMODE_EXCEPTION,\n  PDO::ATTR_DEFAULT_FETCH_MODE =\u003e PDO::FETCH_ASSOC \n]);\n```\n\nExamples\n-----\n \n#### SELECT\n```php\n// returns $select with value of query\n$select = $db-\u003eselect('SELECT * FROM users WHERE id = ?', [145]);\n```\n#### INSERT\n```php\n// returns value lastInsertId() on success\n$insert = $db-\u003einsert('INSERT INTO users (lastname) VALUES (?)', ['robin']);\n```\n#### DELETE\n```php\n// returns $delete as boolean\n$delete = $db-\u003edelete('DELETE FROM users WHERE id = ?', [456]);\n```\n#### UPDATE\n```php\n// returns $update as boolean\n$update = $db-\u003eupdate('UPDATE cars SET color = ? WHERE model = ?', ['blue', 'Toyota']);\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamayo%2Fstyrofoam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamayo%2Fstyrofoam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamayo%2Fstyrofoam/lists"}