{"comment":{"url":"https://api.github.com/repos/rajesh13ca63/project/comments/15755927","html_url":"https://github.com/rajesh13ca63/project/commit/aeb1887ec166120437aaf4075572d73197007cd8#commitcomment-15755927","id":15755927,"user":{"login":"mfsi-sandeepagrawal","id":960676,"avatar_url":"https://avatars.githubusercontent.com/u/960676?v=3","gravatar_id":"","url":"https://api.github.com/users/mfsi-sandeepagrawal","html_url":"https://github.com/mfsi-sandeepagrawal","followers_url":"https://api.github.com/users/mfsi-sandeepagrawal/followers","following_url":"https://api.github.com/users/mfsi-sandeepagrawal/following{/other_user}","gists_url":"https://api.github.com/users/mfsi-sandeepagrawal/gists{/gist_id}","starred_url":"https://api.github.com/users/mfsi-sandeepagrawal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfsi-sandeepagrawal/subscriptions","organizations_url":"https://api.github.com/users/mfsi-sandeepagrawal/orgs","repos_url":"https://api.github.com/users/mfsi-sandeepagrawal/repos","events_url":"https://api.github.com/users/mfsi-sandeepagrawal/events{/privacy}","received_events_url":"https://api.github.com/users/mfsi-sandeepagrawal/received_events","type":"User","site_admin":false},"position":4,"line":4,"path":"delete.php","commit_id":"aeb1887ec166120437aaf4075572d73197007cd8","created_at":"2016-01-29T09:12:38Z","updated_at":"2016-01-29T09:12:38Z","body":"always use type check.\r\nif ($_POST[\"submit\"] === \"Delete\")\r\n\r\nalso use YODA condition format that is string should be on the left side and variable should be on the right side like below\r\n\r\nif (0 === $user_id)\r\n{\r\n}\r\n\r\nif (0 == $user_id)\r\n{\r\n}\r\n\r\nThis is because if you write in above format and by mistake misses = then the code become \"if (0 = $user_id)\" which will throw php parse error and rest of the code will not execute so you can find the issue and fix.\r\n\r\nand if you write string on the right side and misses = then code will become like below where $user_id will have value set as 0 and the rest of the code will work accordingly without any error by using $user_id=0 and it will be difficult to debug and find the issue\r\nif ($user_id = 0)\r\n"}}