JsonDB.class.php
                                
                                 JsonDB.class.php copied to clipboard
                                
                                    JsonDB.class.php copied to clipboard
                            
                            
                            
                        class returns table as an array but fails to save one
I'm a PHP beginner and this is something I really don't understand.
JSON
[]
PHP
$items = new JsonTable("../itemDB.json");
$currentItems = $items -> selectAll();
$items -> updateAll($currentItems);
$result = $items -> selectAll();
echo $result
Do that 5 times and you get
[[[[[]]]]]
why? What do I have to do with the array from selectAll() so it can get saved again without the weird nesting?
If I understand this correctly, selectAll gets the complete table while updateAll updates the contents of the table. What are my options here?
Check this https://github.com/efesaid/JsonDB.class.php/commit/380551ff78a8ea04a84b821401f5ef85d70eae47 pull request, it will fix your problem.
edit : commit updated.
@efesaid solved it, thanks!