{"id":27958322,"url":"https://github.com/91ahmed/dbtoexcel","last_synced_at":"2026-05-02T06:31:40.211Z","repository":{"id":65536850,"uuid":"594223629","full_name":"91ahmed/DbtoExcel","owner":"91ahmed","description":"Convert database table to excel sheet.  🐘 ","archived":false,"fork":false,"pushed_at":"2023-04-12T06:15:24.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-05T19:38:28.328Z","etag":null,"topics":["database","database-tables","excel","export-to-excel","php"],"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/91ahmed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-27T22:21:02.000Z","updated_at":"2024-09-21T16:25:29.000Z","dependencies_parsed_at":"2023-02-19T11:45:23.982Z","dependency_job_id":null,"html_url":"https://github.com/91ahmed/DbtoExcel","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/91ahmed%2FDbtoExcel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/91ahmed%2FDbtoExcel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/91ahmed%2FDbtoExcel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/91ahmed%2FDbtoExcel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/91ahmed","download_url":"https://codeload.github.com/91ahmed/DbtoExcel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931823,"owners_count":21827175,"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":["database","database-tables","excel","export-to-excel","php"],"created_at":"2025-05-07T18:22:08.042Z","updated_at":"2026-05-02T06:31:40.169Z","avatar_url":"https://github.com/91ahmed.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## DbtoExcel\nPHP script to simplify the process of converting database table to excel sheet.\n\n### # Requirements\n* PHP 7.0 or higher\n* Composer for installation\n\n### # Install\nvia composer\n```\ncomposer require exceldb/dbtoexcel\n```\n\n### # Example\n``` php\n// don't forget to import vendor/autoload.php\nrequire('vendor/autoload.php'); \n\n// Database information\n$extract = new Database\\Excel\\ExtractExcel([\n      'driver' =\u003e 'mysql',\n      'host' =\u003e '127.0.0.1',\n      'username' =\u003e 'root',\n      'password' =\u003e '',\n      'database' =\u003e 'test',\n      'port' =\u003e '3306',\n      'charset' =\u003e 'utf8',\n      'sslmode' =\u003e 'disable'\n]);\n\n$extract-\u003etable('users'); // Specify the database table.\n$extract-\u003ecolumns('*'); // Specify the columns you need to extract.\n$extract-\u003eexecute(); // Execute the script.\n```\n\n### # Description\n\nThe **TableToExcel** class constructor takes one parameter, which is an *(array)* of the database information.\n\n`table()`\u003cbr/\u003e\u003cbr/\u003e\nThis method used to specify the database table you need to extract, it takes one parameter *(string)* which is the name of the table.\n\n`columns()`\u003cbr/\u003e\u003cbr/\u003e\nUsed to specify the columns you need to extract from the database table, it takes one parameter *(string)* which is the column's names.\n\nTo extract all columns just add __asterisk (*)__ or leave the parameter empty while if you want to extract specific columns you can write the columns names following by comma separator.. see the example below.\n\n``` php\nuse ExtractDatabaseToExcel\\TableToExcel;\n\n$extract = new TableToExcel([\n      'driver' =\u003e 'mysql',\n      'host' =\u003e '127.0.0.1',\n      'username' =\u003e 'root',\n      'password' =\u003e '',\n      'database' =\u003e 'test',\n      'port' =\u003e '3306',\n      'charset' =\u003e 'utf8'\n]);\n\n$extract-\u003etable('users');\n$extract-\u003ecolumns('username, email, age'); // Extract specific columns\n$extract-\u003eexecute();\n```\n\n`execute()`\u003cbr/\u003e\u003cbr/\u003e\nThis is the last method you should invoke to execute the script, the method will convert the data and download the excel file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F91ahmed%2Fdbtoexcel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F91ahmed%2Fdbtoexcel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F91ahmed%2Fdbtoexcel/lists"}