I am using a codeigniter framework but I think the question will be easy to understand. I need to pass to 2 $_POST variables to a function in my models the function is model function->
function new_todo($content)
{
$date = date('l js \of F Y h:i:s A');
$data = array(
'my_day' => $date ,
'content' => $content ,
'author' => 'Misheck'
);
$this->db->insert('query7',$data);
}
So originally I was just retrieving one value but now I need to add another value for the author.
So in my controller I had this originally controller ->
function add_item()
{
$content = $this->input->post('content');
$this->todo_model->new_todo($content);
redirect('');
}
So now I will add another $author = $this->input->post('author'); after the content variable. I will need to change new_todo($content); and convert that data into an array like this
alternative solution ->
$content = $this->input->post('content');
$author = $this->input->post('author');
$stuff = new array($content, $author)
$this->todo_model->new_todo($stuff);
I am now not sure on how I will be able to use or retrieve this data in new_todo() function? I am just short of logical thinking and I am new to Php and MVC.