Need your help. I have a table with 3 columns (id, name, filename) name
and filename
are a string. The id
field is AUTO_INCREMENT
so I don't have to post it on array. But the problem is on the filename
field which is a combination string of id
and name
with '-' delimiter.
My expected results of filename
is
+---+-------+-----------+
|id | Name | Filename |
+---+-------+-----------+
| 1 | James | 1-James |
| 2 | John | 2-John |
| 3 | Clark | 3-Clark |
+---+-------+-----------+
My code is:
$data = array(
'name' = $this->input->post('name');
'filename' =$this->input->id->post('name');
)
$this->db->insert('dbname', $data)
?>