[eluser]Unknown[/eluser]
Hi everyone,
I want in database save data from send form. Function for storage is here:
Code:
function add()
{
$data = array(
'title' => ( ! isset($this->lang['scaff_add'])) ? 'Add Data' : $this->lang['scaff_add'],
'fields' => $this->CI->db->field_data($this->current_table),
'action' => $this->base_uri.'/insert'
);
$this->CI->load->view('add', $data);
}
and her calls:
Code:
function add($type,$one="",$two="",$three=""){
$type = str_replace("-", "_", $type);
$sql = "INSERT INTO table$type (one,two,three) VALUES ('$one','$two','$three')";
$query = $this->ci->db->query($sql);
if($query AND $query_sort){
return true;
}else{
return false;
}
}
This is OK.
But I need 4 variables saved in table:
Code:
function add($type,$one="",$two="",$three="",$four=""){
...
$sql = "INSERT INTO table$type (one,two,three,four) VALUES ('$one','$two','$three','$four')";
...
}
But column "four" is always empty :/ When that I try this:
Code:
function add($type,$one="",$two="",$four=""){
...
$sql = "INSERT INTO table$type (one,two,four) VALUES ('$one','$two','$four')";
Column "four" is not now empty...
And I needed function add() extend so, to work up all four parameters...
I'm so sorry for my english and thanks for help