{"id":28451248,"url":"https://github.com/systemvll/database-php-class","last_synced_at":"2025-06-30T21:32:05.257Z","repository":{"id":46100438,"uuid":"496339946","full_name":"SystemVll/database-php-class","owner":"SystemVll","description":"A pre-builded php class for using mysql without caring about SQL and XSS attacks","archived":false,"fork":false,"pushed_at":"2022-05-26T22:06:21.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-28T04:13:08.590Z","etag":null,"topics":[],"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/SystemVll.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":"2022-05-25T18:05:54.000Z","updated_at":"2024-05-23T20:23:30.000Z","dependencies_parsed_at":"2022-09-01T11:03:01.149Z","dependency_job_id":null,"html_url":"https://github.com/SystemVll/database-php-class","commit_stats":null,"previous_names":["systemvll/database-php-class"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SystemVll/database-php-class","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystemVll%2Fdatabase-php-class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystemVll%2Fdatabase-php-class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystemVll%2Fdatabase-php-class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystemVll%2Fdatabase-php-class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SystemVll","download_url":"https://codeload.github.com/SystemVll/database-php-class/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystemVll%2Fdatabase-php-class/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262853244,"owners_count":23374925,"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":"2025-06-06T16:10:22.992Z","updated_at":"2025-06-30T21:32:05.149Z","avatar_url":"https://github.com/SystemVll.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Mysql Database Class\n\nThis php class is a simple oriented object mysql client base\non pdo, it **preventing** from ***SQL*** injection and ***XSS*** attacks.\n\n#### Init the database object\n```php\nrequire 'class/database.class.php'\n\n$GLOBALS['MYSQL'] = new Database(\n\t\"localhost\",\n\t\"database\",\n\t\"username\",\n\t\"password\"\n);\n```\n\n#### Getting data from SQL tables\n```php\n// returning an array of all the table content\n$GLOBALS['MYSQL']-\u003egetContent(\"table\");\n\n// returning an array of all the table content where exemple_colum is equal to 30\n$GLOBALS['MYSQL']-\u003egetContent(\"table\", [\"exemple_colum\" =\u003e 30]);\n```\n\n#### Inserting data into database\n```php\n// Inserting a new line to the table with exemple_colum equal to 30\n$GLOBALS['MYSQL']-\u003eInsert(\"table\", [\n\t\"exemple_colum\" =\u003e 30\n]);\n\n// Inserting a new line to the table with exemple_colum equal to 30 without the XSS filter\n$GLOBALS['MYSQL']-\u003eInsert(\"table\", [\n\t\"exemple_colum\" =\u003e 30\n], false);\n```\n\n#### Updating data into database\n```php\n// Put 60 in the column exemple_colum whre exemple_colum equal to 30\n$GLOBALS['MYSQL']-\u003eupdate(\"table\", [\n\t\"exemple_colum\" =\u003e 30\n], [\n\t\"exemple_colum\" =\u003e 60\n]);\n\n// Put 60 in the column exemple_colum whre exemple_colum equal to 30 without the XSS filter\n$GLOBALS['MYSQL']-\u003eupdate(\"table\", [\n\t\"exemple_colum\" =\u003e 30\n], [\n\t\"exemple_colum\" =\u003e 60\n], false);\n```\n\n\n#### Delete a line\n```php\n// Delete lines where exemple_colum equal to 60\n$GLOBALS['MYSQL']-\u003edelete(\"table\", [\n\t\"exemple_colum\" =\u003e 60\n]);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemvll%2Fdatabase-php-class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemvll%2Fdatabase-php-class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemvll%2Fdatabase-php-class/lists"}