Welcome Guest, Not a member yet? Register   Sign In
Insert using class
#1

/*
class Myclass {
       public $title = 'My Title';
       public $content = 'My Content';
       public $date = 'My Date';
}
*/

$object = new Myclass;
$this->db->insert('mytable', $object);

So like this i can do insert, but if i i want to  use input-post function with my variables
like this:  public $title = $this->input->post('some'); how i can do this?
Reply
#2

$object->title = $this->input->post('some');
Reply
#3

(05-17-2016, 12:21 PM)Wouter60 Wrote: $object->title = $this->input->post('some');

/*
class Myclass {
       public $title = 'My Title';
       public $content = 'My Content';
       public $date = 'My Date';
}
*/

but this class is outside my main class, i still cant use like this post function
Reply




Theme © iAndrew 2016 - Forum software by © MyBB