{"action":"created","issue":{"url":"https://api.github.com/repos/joshcam/PHP-MySQLi-Database-Class/issues/425","labels_url":"https://api.github.com/repos/joshcam/PHP-MySQLi-Database-Class/issues/425/labels{/name}","comments_url":"https://api.github.com/repos/joshcam/PHP-MySQLi-Database-Class/issues/425/comments","events_url":"https://api.github.com/repos/joshcam/PHP-MySQLi-Database-Class/issues/425/events","html_url":"https://github.com/joshcam/PHP-MySQLi-Database-Class/issues/425","id":127599806,"number":425,"title":"dbObject update does not seem to be working","user":{"login":"mjbaga","id":5286661,"avatar_url":"https://avatars.githubusercontent.com/u/5286661?v=3","gravatar_id":"","url":"https://api.github.com/users/mjbaga","html_url":"https://github.com/mjbaga","followers_url":"https://api.github.com/users/mjbaga/followers","following_url":"https://api.github.com/users/mjbaga/following{/other_user}","gists_url":"https://api.github.com/users/mjbaga/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbaga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbaga/subscriptions","organizations_url":"https://api.github.com/users/mjbaga/orgs","repos_url":"https://api.github.com/users/mjbaga/repos","events_url":"https://api.github.com/users/mjbaga/events{/privacy}","received_events_url":"https://api.github.com/users/mjbaga/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-20T04:06:56Z","updated_at":"2016-01-22T03:28:01Z","closed_at":null,"body":"I just tested this out.\r\n\r\nclass Car extends dbObject {\r\n\tprotected $dbTable = \"cars\";\r\n}\r\n\r\ncar = Car::byId(1);\r\n$car->plate_number = \"ABC 123\";\r\n\r\nif($car->save()) {\r\n   echo \"Success\";\r\n} else {\r\n   echo \"Error\";\r\n}\r\n\r\nThis returns error to me. Querying and adding are working just fine.\r\n\r\npublic function update ($data = null) {\r\n        if (empty ($this->dbFields)) <- returns 1 always\r\n...\r\n\r\nI think I'm using it right.\r\n\r\nAnyway, hope you get back. Thanks.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/joshcam/PHP-MySQLi-Database-Class/issues/comments/173794285","html_url":"https://github.com/joshcam/PHP-MySQLi-Database-Class/issues/425#issuecomment-173794285","issue_url":"https://api.github.com/repos/joshcam/PHP-MySQLi-Database-Class/issues/425","id":173794285,"user":{"login":"mjbaga","id":5286661,"avatar_url":"https://avatars.githubusercontent.com/u/5286661?v=3","gravatar_id":"","url":"https://api.github.com/users/mjbaga","html_url":"https://github.com/mjbaga","followers_url":"https://api.github.com/users/mjbaga/followers","following_url":"https://api.github.com/users/mjbaga/following{/other_user}","gists_url":"https://api.github.com/users/mjbaga/gists{/gist_id}","starred_url":"https://api.github.com/users/mjbaga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjbaga/subscriptions","organizations_url":"https://api.github.com/users/mjbaga/orgs","repos_url":"https://api.github.com/users/mjbaga/repos","events_url":"https://api.github.com/users/mjbaga/events{/privacy}","received_events_url":"https://api.github.com/users/mjbaga/received_events","type":"User","site_admin":false},"created_at":"2016-01-22T03:28:00Z","updated_at":"2016-01-22T03:28:00Z","body":"I've set up anew.\r\n\r\nuser.php:\r\nclass User extends dbObject {\r\n\r\n\tprotected $dbTable = \"users\";\r\n\r\n}\r\n----\r\nindex.php:\r\nrequire_once('classes/MysqliDb.php');\r\nrequire_once('classes/dbObject.php');\r\n\r\n$db = new MysqliDb('localhost', 'root', '', 'testdb');\r\n\r\ndbObject::autoload(\"classes/models\");\r\n\r\n$user = User::byId(1);\r\n\r\necho '<pre>';\r\nprint_r($user->data);\r\necho '</pre>';\r\n\r\n$user->first_name = \"Jane\";\r\n\r\nif($user->save()) echo \"success\";\r\nelse echo \"error\";\r\n---\r\n\r\nReturns me this:\r\nArray\r\n(\r\n    [id] => 1\r\n    [first_name] => John\r\n    [last_name] => Doe\r\n)\r\nerror\r\n\r\nCan't update. I'm also trying to fix, but to no avail yet. Anyway, just letting you know."}}