{"action":"created","issue":{"url":"https://api.github.com/repos/strzlee/JsonDB.class.php/issues/6","labels_url":"https://api.github.com/repos/strzlee/JsonDB.class.php/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/strzlee/JsonDB.class.php/issues/6/comments","events_url":"https://api.github.com/repos/strzlee/JsonDB.class.php/issues/6/events","html_url":"https://github.com/strzlee/JsonDB.class.php/issues/6","id":53622816,"number":6,"title":"class returns table as an array but fails to save one","user":{"login":"codeofsumit","id":2399810,"avatar_url":"https://avatars.githubusercontent.com/u/2399810?v=3","gravatar_id":"","url":"https://api.github.com/users/codeofsumit","html_url":"https://github.com/codeofsumit","followers_url":"https://api.github.com/users/codeofsumit/followers","following_url":"https://api.github.com/users/codeofsumit/following{/other_user}","gists_url":"https://api.github.com/users/codeofsumit/gists{/gist_id}","starred_url":"https://api.github.com/users/codeofsumit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeofsumit/subscriptions","organizations_url":"https://api.github.com/users/codeofsumit/orgs","repos_url":"https://api.github.com/users/codeofsumit/repos","events_url":"https://api.github.com/users/codeofsumit/events{/privacy}","received_events_url":"https://api.github.com/users/codeofsumit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-07T11:26:58Z","updated_at":"2015-01-07T11:41:23Z","closed_at":null,"body":"I'm a PHP beginner and this is something I really don't understand.\r\n\r\nJSON\r\n```\r\n[]\r\n```\r\n\r\nPHP\r\n\r\n```\r\n$items = new JsonTable(\"../itemDB.json\");\r\n\r\n$currentItems = $items -> selectAll();\r\n\r\n$items -> updateAll($currentItems);\r\n\r\n$result = $items -> selectAll();\r\n\r\necho $result\r\n```\r\n\r\nDo that 5 times and you get\r\n```\r\n[[[[[]]]]]\r\n```\r\n\r\nwhy? What do I have to do with the array from `selectAll()` so it can get saved again without the weird nesting?\r\n\r\nIf I understand this correctly, `selectAll` gets the complete table while `updateAll` updates the contents of the table. What are my options here?"},"comment":{"url":"https://api.github.com/repos/strzlee/JsonDB.class.php/issues/comments/69011242","html_url":"https://github.com/strzlee/JsonDB.class.php/issues/6#issuecomment-69011242","issue_url":"https://api.github.com/repos/strzlee/JsonDB.class.php/issues/6","id":69011242,"user":{"login":"efesaid","id":2371121,"avatar_url":"https://avatars.githubusercontent.com/u/2371121?v=3","gravatar_id":"","url":"https://api.github.com/users/efesaid","html_url":"https://github.com/efesaid","followers_url":"https://api.github.com/users/efesaid/followers","following_url":"https://api.github.com/users/efesaid/following{/other_user}","gists_url":"https://api.github.com/users/efesaid/gists{/gist_id}","starred_url":"https://api.github.com/users/efesaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efesaid/subscriptions","organizations_url":"https://api.github.com/users/efesaid/orgs","repos_url":"https://api.github.com/users/efesaid/repos","events_url":"https://api.github.com/users/efesaid/events{/privacy}","received_events_url":"https://api.github.com/users/efesaid/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T11:41:23Z","updated_at":"2015-01-07T11:41:23Z","body":"Check this https://github.com/efesaid/JsonDB.class.php/commit/287f3e81f31647c5c10d06602085aa808a488834  pull request, it will fix your problem."}}