error creating in my controller - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1) +--- Forum: Lounge (https://forum.codeigniter.com/forumdisplay.php?fid=3) +--- Thread: error creating in my controller (/showthread.php?tid=71753) |
error creating in my controller - kvanaraj - 09-19-2018 Code: controller Model Code: public function getapp(){ RE: error creating in my controller - Pertti - 09-19-2018 You didn't actually say where the error is, but looking at the source, you are not validating that username actually exists in session, so $regno could evaluate to 'false' and potentially as result that creates invalid SQL query. where_in for example is painful method in that sense, it accepts empty array, but then creates "field IN ()" which throws SQL error. RE: error creating in my controller - davidgv88 - 09-19-2018 Controller (application/controllers/Home.php) PHP Code: <?php Model (application/models/User_model.php) PHP Code: <?php IMPORTANT!! in application/config/autoload.php add database and session libraries. Example: PHP Code: $autoload['libraries'] = array('database','session'); With this works! Please check the $regno variable in controller. Sometimes can be null and generate a invalid SQL. |