{"id":19932402,"url":"https://github.com/adamwulf/json-to-mysql","last_synced_at":"2025-05-03T11:32:17.136Z","repository":{"id":11268366,"uuid":"13673038","full_name":"adamwulf/json-to-mysql","owner":"adamwulf","description":"Easily take any JSON object and create+insert it into a mysql table built from its structure. Also search, update, index, and validate tables with JSON.","archived":false,"fork":false,"pushed_at":"2021-04-11T05:39:50.000Z","size":56,"stargazers_count":136,"open_issues_count":10,"forks_count":62,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-07T15:11:12.645Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamwulf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"adamwulf","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2013-10-18T08:36:55.000Z","updated_at":"2025-04-02T07:35:39.000Z","dependencies_parsed_at":"2022-09-02T13:31:31.208Z","dependency_job_id":null,"html_url":"https://github.com/adamwulf/json-to-mysql","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/adamwulf%2Fjson-to-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwulf%2Fjson-to-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwulf%2Fjson-to-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamwulf%2Fjson-to-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamwulf","download_url":"https://codeload.github.com/adamwulf/json-to-mysql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252184747,"owners_count":21708013,"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-11-12T23:10:01.602Z","updated_at":"2025-05-03T11:32:16.589Z","avatar_url":"https://github.com/adamwulf.png","language":"PHP","funding_links":["https://github.com/sponsors/adamwulf"],"categories":[],"sub_categories":[],"readme":"json-to-mysql\n=============\n\nEasily take any JSON object and create+insert it into a mysql table built from its structure. Also search, update, index, and validate tables with JSON.\n\n```\n\ninclude(\"config.php\");\ninclude(\"include.classloader.php\");\n\n$classLoader-\u003eaddToClasspath(ROOT);\n\n\n$mysql = new MySQLConn(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASS);\n\n$db = new JSONtoMYSQL($mysql);\n\n// create some json\n$obj = json_decode('{\"id\":4,\"name\" : \"asfd\"}');\n\n// save it to a table\n$db-\u003esave($obj, \"brandnewtable\");\n\n// SELECT * from brandnewtable WHERE id = 4\n\n$obj = $db-\u003etable(\"brandnewtable\")-\u003efind([\"id\" =\u003e 4]);\n\nprint_r($obj);\n\n// SELECT * FROM brandnewtable WHERE id \u003e 4 ORDER BY name DESC\n\n$obj = $db-\u003etable(\"brandnewtable\")-\u003efind([\"id\" =\u003e 4], [\"id\" =\u003e \"\u003e\"], [\"name DESC\"]);\n\nprint_r($obj);\n\n// SELECT * FROM brandnewtable WHERE id IN (4, 5, 6, 7)\n\n$obj = $db-\u003etable(\"brandnewtable\")-\u003efind([\"id\" =\u003e [4, 5, 6, 7]]);\n\nprint_r($obj);\n\n\n```\n\n## Support the project\n\nHas json-to-mysql saved you some time? Become a [Github Sponsor](https://github.com/sponsors/adamwulf) and buy me a coffee ☕️ 😄\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamwulf%2Fjson-to-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamwulf%2Fjson-to-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamwulf%2Fjson-to-mysql/lists"}