Welcome Guest, Not a member yet? Register   Sign In
Can I use a global inset/update function
#11

[eluser]Rodrigo Ferreira[/eluser]
The set_validation method is not set in your model.

In your model:
[code]
public function set_validation($validate) {
$this->validate = array_merge($this->validate, $validate);
}
[code]
#12

[eluser]simplepixie[/eluser]
Well that stops the blank page but my rules don't seem to be working??

For example I have tried putting a space after the first name and thought this would be trimmed but it isn't and also tried submitting without an email address but all that happens is the original email is retained, however if I alter the email address that does update the db.

I am sorry if this is all a bit newbie but I am struggling to get my head around using CI and HMVC for the first time.
#13

[eluser]Rodrigo Ferreira[/eluser]
That's the default behavior: the form validation library updates the $_POST array, not the $insert_data array. If you want to use changed data (not only check if it is valid or not), you need to repopulate you insert/update array against the $_POST array *before* actual insert/update to the DB.




Theme © iAndrew 2016 - Forum software by © MyBB