Welcome Guest, Not a member yet? Register   Sign In
using input->post in model?
#2

(08-05-2015, 02:48 PM)alexandervj Wrote: I'm trying to get values from the user input and use them in a where statement in the model, something like $this->db->where('partName, $this->input->post("partName")');

but I'm pretty sure I cant do that. Is there a way to use those input values in the model like I want to do though? Thanks

You can do that

PHP Code:
class Some_model extends CI_Model {
 
   public function __construct() {
 
       parent::__construct();
 
       // ...
 
   }
 
   public function do_something() {
 
       // ...
 
       $this->db->where('partName'$this->input->post("partName"));
        
// ...
 
   }

Reply


Messages In This Thread
using input->post in model? - by alexandervj - 08-05-2015, 02:48 PM
RE: using input->post in model? - by pdthinh - 08-05-2015, 10:02 PM
RE: using input->post in model? - by alexandervj - 08-06-2015, 08:35 AM
RE: using input->post in model? - by pdthinh - 08-06-2015, 09:31 AM
RE: using input->post in model? - by alexandervj - 08-06-2015, 11:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB