{"action":"opened","issue":{"url":"https://api.github.com/repos/mevdschee/php-crud-api/issues/89","repository_url":"https://api.github.com/repos/mevdschee/php-crud-api","labels_url":"https://api.github.com/repos/mevdschee/php-crud-api/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/mevdschee/php-crud-api/issues/89/comments","events_url":"https://api.github.com/repos/mevdschee/php-crud-api/issues/89/events","html_url":"https://github.com/mevdschee/php-crud-api/issues/89","id":165028974,"number":89,"title":"Error with include","user":{"login":"khkassem","id":20416286,"avatar_url":"https://avatars.githubusercontent.com/u/20416286?v=3","gravatar_id":"","url":"https://api.github.com/users/khkassem","html_url":"https://github.com/khkassem","followers_url":"https://api.github.com/users/khkassem/followers","following_url":"https://api.github.com/users/khkassem/following{/other_user}","gists_url":"https://api.github.com/users/khkassem/gists{/gist_id}","starred_url":"https://api.github.com/users/khkassem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khkassem/subscriptions","organizations_url":"https://api.github.com/users/khkassem/orgs","repos_url":"https://api.github.com/users/khkassem/repos","events_url":"https://api.github.com/users/khkassem/events{/privacy}","received_events_url":"https://api.github.com/users/khkassem/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-12T09:08:28Z","updated_at":"2016-07-12T09:08:28Z","closed_at":null,"body":"Hi,\r\n\r\nI am experiencing a problem trying to run the following url on the attached database :\r\n\r\napi.php/sections?include=departments\r\n\r\nI am getting the folowing error :\r\n\r\n> {\"sections\":{\"columns\":[\"ID\",\"NAME\",\"DEPARTMENT_ID\",\"PHONE_NUMBER\",\"ROOM_NUMBER\"],\"records\":[[\"1\",\"sect 1\",\"1\",\"658\",\"987\"],[\"2\",\"sect 2\",\"2\",\"657\",\"698\"]]},\"mail_sent\":{\"relations\":{\"SECTION_ID\":\"sections.ID\"},\"columns\":[\"DESC\",\"DIRECTORATE_ID\",\"ID\",\"SENDING_DATE\",\"DEPARTMENT_ID\",\"SECTION_ID\"],\"records\":[]},\"departments\":{\"relations\":{\"ID\":\"mail_sent.DEPARTMENT_ID\"}<br />\r\n<font size='1'><table class='xdebug-error xe-notice' dir='ltr' border='1' cellspacing='0' cellpadding='1'>\r\n<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Undefined index: departments in C:\\devz\\workspace\\edlmsphp\\src\\main\\webapp\\php\\lib\\api.php on line <i>1395</i></th></tr>\r\n<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>\r\n<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>\r\n<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0038</td><td bgcolor='#eeeeec' align='right'>856704</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\\devz\\workspace\\edlmsphp\\src\\main\\webapp\\php\\lib\\api.php' bgcolor='#eeeeec'>..\\api.php<b>:</b>0</td></tr>\r\n<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0055</td><td bgcolor='#eeeeec' align='right'>872016</td><td bgcolor='#eeeeec'>PHP_CRUD_API->executeCommand(  )</td><td title='C:\\devz\\workspace\\edlmsphp\\src\\main\\webapp\\php\\lib\\api.php' bgcolor='#eeeeec'>..\\api.php<b>:</b>1934</td></tr>\r\n<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.0085</td><td bgcolor='#eeeeec' align='right'>924056</td><td bgcolor='#eeeeec'>PHP_CRUD_API->listCommand(  )</td><td title='C:\\devz\\workspace\\edlmsphp\\src\\main\\webapp\\php\\lib\\api.php' bgcolor='#eeeeec'>..\\api.php<b>:</b>1912</td></tr>\r\n<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.0086</td><td bgcolor='#eeeeec' align='right'>930064</td><td bgcolor='#eeeeec'>PHP_CRUD_API->listCommandInternal(  )</td><td title='C:\\devz\\workspace\\edlmsphp\\src\\main\\webapp\\php\\lib\\api.php' bgcolor='#eeeeec'>..\\api.php<b>:</b>1471</td></tr>\r\n</table></font>\r\n,\"columns\":[\"ID\",\"NAME\",\"DIRECTORATE_ID\",\"EDL_ID\",\"PHONE_NUMBER\",\"ROOM_NUMBER\"],\"records\":[[\"1\",\"department 1\",\"1\",\"1\",\"1236\",\"321\"],[\"2\",\"depart 2\",\"2\",\"2\",\"256\",\"6987\"]]}}\r\n\r\n\r\nif I delete the MAIL_TO table, its working correctly?\r\n\r\n\r\n[test.txt](https://github.com/mevdschee/php-crud-api/files/358922/test.txt)\r\n"}}
{"actor":{"display_login":"khkassem"}}