Welcome Guest, Not a member yet? Register   Sign In
Model/Controller Quick Question
#5

[eluser]Christopher Blankenship[/eluser]
I agree with Bulk, passing post variables directly into a database is bad form; if you intend the application to be for anything other than a quick and dirty example (which I apologize for) or in this case a task management system for myself which is not accessible by anyone but myself. So to that end:
Code:
/* controller: add_task_rec
* this however could be separated out to the model
* if so wished but the point is to pass all the information
* as an array to avoid the $_POST groups.
*/
   $this->db->insert('ticket', $_POST['rec']);
   redirect("$base_url");
would be as follows:
Code:
/* controller: add_task_rec
* this however could be separated out to the model
* if so wished but the point is to pass all the information
* as an array to avoid the $_POST groups.
*/
   $recs = $_POST['rec'];
   $this->db->insert('ticket', $recs);
   redirect("$base_url");


Messages In This Thread
Model/Controller Quick Question - by El Forum - 07-02-2007, 04:21 PM
Model/Controller Quick Question - by El Forum - 07-02-2007, 04:49 PM
Model/Controller Quick Question - by El Forum - 07-02-2007, 05:28 PM
Model/Controller Quick Question - by El Forum - 07-03-2007, 02:18 AM
Model/Controller Quick Question - by El Forum - 07-03-2007, 11:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB