Welcome Guest, Not a member yet? Register   Sign In
Passing Data to a Model
#1

[eluser]Jesse Schutt[/eluser]
So, forums are places to ask questions, right? Hopefully you can help me out with this simple one.

I have a need to update a field on my DB. So I should have that function with in my model, correct? Here is the code for my controller

Code:
$paypal_custom_field = explode(":", $this->paypal_lib->ipn_data['custom']);

            $this->load->model('regform_model', '', TRUE);
            $this->regform_model->verify_payment($paypal_custom_field);

Here is what is in my model function called "verify_payment"

Code:
function verify_payment()
    {
    
        $this->db->where('first_name', $paypal_custom_field[ 0]);
        $this->db->where('last_name', $paypal_custom_field[ 1]);
        $this->db->where('email', $paypal_custom_field[ 2]);

        $this->db->set('payment_received', TRUE);
        $this->db->update('table_name');
    }

I just can't get this to update the "payment_received" field. If I take the code from the model and put it into my controller, it will update the field correctly. So I am assuming that it has to do with passing the array to the model.

Any ideas?

Thanks in advance!

Jesse


Messages In This Thread
Passing Data to a Model - by El Forum - 08-30-2008, 11:09 AM
Passing Data to a Model - by El Forum - 08-30-2008, 11:41 AM
Passing Data to a Model - by El Forum - 08-30-2008, 12:06 PM
Passing Data to a Model - by El Forum - 08-30-2008, 12:09 PM
Passing Data to a Model - by El Forum - 08-30-2008, 12:11 PM
Passing Data to a Model - by El Forum - 08-30-2008, 12:13 PM
Passing Data to a Model - by El Forum - 08-30-2008, 12:24 PM
Passing Data to a Model - by El Forum - 08-30-2008, 12:42 PM
Passing Data to a Model - by El Forum - 08-30-2008, 12:42 PM
Passing Data to a Model - by El Forum - 08-30-2008, 12:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB