{"action":"created","issue":{"url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/172","repository_url":"https://api.github.com/repos/thedigicraft/Atom.CMS","labels_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/172/comments","events_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/172/events","html_url":"https://github.com/thedigicraft/Atom.CMS/issues/172","id":137899870,"number":172,"title":"Part 56: Admin - Switch statement ","user":{"login":"dbashby","id":6895380,"avatar_url":"https://avatars.githubusercontent.com/u/6895380?v=3","gravatar_id":"","url":"https://api.github.com/users/dbashby","html_url":"https://github.com/dbashby","followers_url":"https://api.github.com/users/dbashby/followers","following_url":"https://api.github.com/users/dbashby/following{/other_user}","gists_url":"https://api.github.com/users/dbashby/gists{/gist_id}","starred_url":"https://api.github.com/users/dbashby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbashby/subscriptions","organizations_url":"https://api.github.com/users/dbashby/orgs","repos_url":"https://api.github.com/users/dbashby/repos","events_url":"https://api.github.com/users/dbashby/events{/privacy}","received_events_url":"https://api.github.com/users/dbashby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-02T15:08:54Z","updated_at":"2016-03-02T15:35:19Z","closed_at":null,"body":"Everything that is meant to be working does right up until video 56 and the switch statement.\r\n\r\nI have gone through the video several times and bar the if statement the code is the same\r\n\r\n`if (isset($_POST['id']) && $_POST['id'] != '') {`\r\n\r\nI have even tried to use Alans switch statement trying both his exact code but also with the edited if as above.  \r\n\r\nThe Update and Insert queries have been a major headache but now I have no idea as to why right up until the switch everything is functioning.\r\n\r\nBy the end of part 56 I am unable to edit pages despite not doing anything with the pages since copying and pasting the if/update and insert into the switch.\r\n\r\nAnd even if I cut the user case out and try to run pages.php I have lost the ability to edit pages and add new ones.\r\n\r\nOnce I paste \r\n\r\n`if(isset($_GET['id'])){\t$opened = data_page($dbc, $_GET['id']); }`\r\n\r\nInto both pages and users editing the users \r\n\r\n`if(isset($_GET['id'])){\t$opened = data_user($dbc, $_GET['id']); }`\r\n\r\nThe form on pages.php does not load the data into the relevant fields anymore but prior to this switch they did.\r\n\r\nThe links below show the code up until the end of Part 57\r\n\r\nThe full form code is http://pastebin.com/a7e16Bxz\r\nThe full switch statement code is http://pastebin.com/JJg9rM2N\r\nThe setup file code is http://pastebin.com/Pdx6d89c\r\n\r\nFrom starting the switch I have lost the ability to show the active state, edit or create a page and display the data for selected option from the menu.\r\n\r\nOn the user.php page I have all the users displayed but again I have lost the active state and again I am not retrieving the selected users data.\r\n\r\nI have no idea why this is happening as the switch should not be causing this issue"},"comment":{"url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/comments/191289733","html_url":"https://github.com/thedigicraft/Atom.CMS/issues/172#issuecomment-191289733","issue_url":"https://api.github.com/repos/thedigicraft/Atom.CMS/issues/172","id":191289733,"user":{"login":"dbashby","id":6895380,"avatar_url":"https://avatars.githubusercontent.com/u/6895380?v=3","gravatar_id":"","url":"https://api.github.com/users/dbashby","html_url":"https://github.com/dbashby","followers_url":"https://api.github.com/users/dbashby/followers","following_url":"https://api.github.com/users/dbashby/following{/other_user}","gists_url":"https://api.github.com/users/dbashby/gists{/gist_id}","starred_url":"https://api.github.com/users/dbashby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbashby/subscriptions","organizations_url":"https://api.github.com/users/dbashby/orgs","repos_url":"https://api.github.com/users/dbashby/repos","events_url":"https://api.github.com/users/dbashby/events{/privacy}","received_events_url":"https://api.github.com/users/dbashby/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T15:35:19Z","updated_at":"2016-03-02T15:35:19Z","body":"If I take the if statement that we cut from the setup.php file\r\n\r\n`if(isset($_GET['id'])){\t$opened = data_user($dbc, $_GET['id']); }`\r\n\r\nand paste it back in setup.php I get the active state back but the form is still empty but all users are still listed \r\n\r\nHowever I do now have the user.php form working, it was a typo but the pages.php form fields still will not populate."}}