A Database Error Occurred
Error Number: 1146
Table 'gtv.1tbpost' doesn't exist
INSERT INTO
1tbpost(post_title) VALUES ('')Filename: C:/xampp/htdocs/1/system/database/DB_driver.php
Line Number: 691
database.php /
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'gtv',
'dbdriver' => 'mysqli',
'dbprefix' => '1',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
model:
public function add(){
$data=array(
'post_title'=>$this->input->post('title'),
);
$this->db->insert('tbpost',$data);
}
controller:
public function add_validate(){
$this->load->library('form_validation');
$this->form_validation->set_rules('title', 'Title', 'trim|required|min_length[6]|regex_match[/^[A-Za-z0-9 .]+$/]');
$this->form_validation->set_rules('image', 'Image', 'trim');
$this->form_validation->set_rules('text', 'Text', 'trim|required|min_length[2]');
$this->form_validation->set_message('required', '%s is required.');
$this->form_validation->set_message('min_length', 'minimum characters for %s is %s');
$this->form_validation->set_message('regex_match', '%s is not in the correct format');
if($this->form_validation->run() == FALSE){
if($this->input->post('add') == "post"){
$this->gtvmod->add();
}else if($this->input->post('add') == "save"){
$this->index();
}else if($this->input->post('add') == "cancel"){
$this->index();
}else{
$this->index();
}
}else{
if($this->input->post('add') == "post"){
$this->add();//punta model
}else if($this->input->post('add') == "save"){
$this->index();//punta model
}else if($this->input->post('add') == "cancel"){
$this->index();//punta model
}else{
$this->index();//punta model
}
}
}
problem I specify that my table is 'tbpost' but the error says that I insert into table '1tbpost' .