• 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
addnewsletters

#1
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">
                        <
div class="widget-title"><h5>Administrator</h5></div>
                        <
div class="widget-content">
                        
                        <
table border="0" style="width: 100%; height: 90px;">
                            <
tr>
                                <
td>Newsletter Name:</td>
                                <
td><input type="text" name="newsl_name"></td>
                            </
tr>
                            <
tr>
                                <
td>Newsletter Date:</td>
                                <
td><input type="text" name="newsl_date"></td>
                         
   </tr>
                            <
tr>
                                <
td>Newsletter Content:</td>
                                <
td><textarea name="newsl_content"></textarea></td>
                         
   </tr>    
                            <
tr>
                                <
td></td>
                                <
td><input type="submit" class="add" name="submit" value="SUBMIT" /></td>
                         
   </tr>    
                        </
table>            
                        </
div>
                    </
div



models/Mpages.php



PHP Code:
public function add_newsletters()
    {
                    
        
$data = array(
         
   'newsl_name' => $this->input->post('newsl_name'),
            
'newsl_date' => $this->input->post('newsl_date'),
            
'newsl_content' => $this->input->post('newsl_content')
        );
    
        return 
$this->db->insert('newsletter'$data);    
    
    } 


controllers/cpages.php



PHP Code:
public function addnewsletters() { 
    
        
$this->form_validation->set_rules('newsletter_name''Newsletter Name''required');
        
$this->form_validation->set_rules('newsletter_content''Newsletter Content''required');
                
        if(
$this->form_validation->run() === FALSE)
        {
            
            
$this->Mpages->add_newsletters();
            
$this->load->view('addnewsletterssuccess');
 
          
        
}
        else
        {
            
             
$this->load->view('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
" If I looks more intelligence please increase my reputation."
Reply


Messages In This Thread
addnewsletters - by davy_yg - 07-13-2016, 08:27 AM
RE: addnewsletters - by InsiteFX - 07-13-2016, 08:43 AM
RE: addnewsletters - by ciadmin - 07-13-2016, 08:43 AM
RE: addnewsletters - by davy_yg - 07-13-2016, 06:18 PM
RE: addnewsletters - by davy_yg - 07-16-2016, 09:34 PM
RE: addnewsletters - by InsiteFX - 07-14-2016, 03:06 AM
RE: addnewsletters - by Avenirer - 07-15-2016, 05:22 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.