{"id":17983529,"url":"https://github.com/techjacker/pdo-quick","last_synced_at":"2025-04-04T02:13:06.210Z","repository":{"id":1586490,"uuid":"2085916","full_name":"techjacker/PDO-Quick","owner":"techjacker","description":"A lightweight PHP class that securely handles PDO connections and includes simple querying methods","archived":false,"fork":false,"pushed_at":"2013-06-24T17:29:02.000Z","size":108,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T13:37:03.638Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://andrewgriffithsonline.com/software/pdo-quick/","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/techjacker.png","metadata":{"files":{"readme":"README.md","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":"2011-07-21T21:50:41.000Z","updated_at":"2015-05-11T18:05:05.000Z","dependencies_parsed_at":"2022-08-26T21:54:21.786Z","dependency_job_id":null,"html_url":"https://github.com/techjacker/PDO-Quick","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjacker%2FPDO-Quick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjacker%2FPDO-Quick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjacker%2FPDO-Quick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjacker%2FPDO-Quick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techjacker","download_url":"https://codeload.github.com/techjacker/PDO-Quick/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247107828,"owners_count":20884797,"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":[],"created_at":"2024-10-29T18:17:35.134Z","updated_at":"2025-04-04T02:13:06.196Z","avatar_url":"https://github.com/techjacker.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## **Notice: No Longer Actively Maintained\nPlease let me know if you would like to adopt this project as I no longer have time to maintain it.\n\n\n#### Description\nA PDO connection class using the singleton factory design pattern. Inspired by [Jon Raphaelson’s answer](http://stackoverflow.com/questions/130878/global-or-singleton-for-database-connection/219599#219599) to [this stackoverflow question](http://stackoverflow.com/questions/130878/global-or-singleton-for-database-connection).\n\n#### Licence\nReleased under an MIT licence.\n\n\n#### Advantages of using this Class\n\n* Security – all connection variables are protected and private methods\n* Flexibility – you can supply your own prepared statements\n* Simplicity – include podquick.php and config.php in your file and you’re good to go!\n* Speed – lightweight class that uses persistent connections to speed up querying\n* Ease – helper functions included to avoid needing to write long prepared statements\n\n\n## Installation\n\n1. Include pdoquick.php in your PHP file\n2. Enter your database name and logins into config.php\n3. Include pdoquick.php in your PHP file\n\n## Class Methods\n\n### Prepared Statements\n\nUse the pdoQuick::getManager()-\u003egeneric($sql, $params) method.\n\n\t/* generic create your own prepared statement example */\n\t$table       = 'City';\n\t$sql         = \"UPDATE $table SET District = ? WHERE Population \u003e ? AND CountryCode = ?\" ;\n\t$params       = array ('Hertfordshire', 421010, 'NLD');\n\n\tpdoQuick::getManager()-\u003egeneric($sql, $params);\n\n### Query Methods\n\n\tpdoQuick::getManager()-\u003eselect()\n\tpdoQuick::getManager()-\u003einsert()\n\n\t/* select example */\n\t$table   = 'City';\n\t$sql     = \"SELECT * FROM $table WHERE CountryCode = ? AND District = ? LIMIT 100\" ;\n\t$params  = array('NLD', 'Utrecht');\n\t$result  = pdoQuick::getManager()-\u003eselect($sql, $params, true);\n\n\t/* insert example */\n\t$table   = 'City';\n\t$row    = array (\n\t\t\t// 'ID' =\u003e 65456 // optional\n\t\t   'Name'         =\u003e 'Farringdon',\n\t\t   'CountryCode'  =\u003e 'GB',\n\t\t   'District'     =\u003e 'London',\n\t\t   'Population'   =\u003e 404561\n\t);\n\t$inserted_row_id = pdoQuick::getManager()-\u003einsert($row, $table);\n\n#### Convenience DB Query Methods\n\nThese assume that all comparisons will be = (ie you cannot use these if you need to add \u003e or \u003c comparisons to your queries).\n\n\tpdoQuick::getManager()-\u003edeleteQuick()\n\tpdoQuick::getManager()-\u003eselectQuick()\n\tpdoQuick::getManager()-\u003eupdateQuick()\n\n\t/* select quick example */\n\t  $table   = 'City';\n\t$where_equals    = array (\n\t\t 'CountryCode'  =\u003e 'NLD',\n\t\t 'District'     =\u003e 'Zuid-Holland'\n\t  );\n\t$result = pdoQuick::getManager()-\u003eselectQuick($where_equals, $table, true);\n\n\n\t/* delete quick example */\n\t$table   = 'City';\n\t$where_equals     = array (\n\t   'CountryCode'  =\u003e 'NLD',\n\t   'District'     =\u003e 'Limburg'\n\t);\n\tpdoQuick::getManager()-\u003edeleteQuick($where_equals, $table, true);\n\n\t/* update quick example */\n\t$table   = 'City';\n\t$new_values       = array ('Population' =\u003e 421018, 'District' =\u003e 'Dorset' );\n\t$where_condition  = array ('CountryCode' =\u003e 'NLD', 'Name' =\u003e 'Amsterdam');\n\n\t$rows_affected = pdoQuick::getManager()-\u003eupdateQuick($new_values, $where_condition, $table, true);","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechjacker%2Fpdo-quick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechjacker%2Fpdo-quick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechjacker%2Fpdo-quick/lists"}