addnewsletters - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: addnewsletters (/showthread.php?tid=65699) |
addnewsletters - davy_yg - 07-13-2016 Hello, I wonder why I have this error message? I already try to add somethings here but it does not works! views/addnewsletters.php PHP Code: <div class="widget-box"> models/Mpages.php PHP Code: public function add_newsletters() controllers/cpages.php PHP Code: public function addnewsletters() { A Database Error Occurred Error Number: 1048 Column 'newsl_name' cannot be null INSERT INTO `newsletter` (`newsl_name`, `newsl_date`, `newsl_content`) VALUES (NULL, NULL, NULL) Filename: C:/Program Files (x86)/EasyPHP-Devserver-16.1/eds-www/CompanyGiondaCI/system/database/DB_driver.php Line Number: 691 RE: addnewsletters - InsiteFX - 07-13-2016 Maybe you need to add a <form> or form_open to tell it where to post to. RE: addnewsletters - ciadmin - 07-13-2016 Read the error message: your database record fields are not defined. You don't have a form inside your view's HTML. I see no connection to your controller's addnewsletters method, and hence no way that input fields will be retrieved. Your validation is checking the wrong input field names. RE: addnewsletters - davy_yg - 07-13-2016 This is the actual form. views/addnewsletters.php PHP Code: <div class="span12"> RE: addnewsletters - InsiteFX - 07-14-2016 Why are you loading the library in a view? It should be loaded in the controller. RE: addnewsletters - Avenirer - 07-15-2016 Also... you are setting rules for "newsletter_name", "newsletter_content" and inserting values from "'newsl_name", "newsl_date" (and "newsl_content") input fields... Hmm... This is hard... RE: addnewsletters - davy_yg - 07-16-2016 (07-13-2016, 06:18 PM)davy_yg Wrote: This is the actual form. |