Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8636079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:08:12+00:00 2026-06-12T10:08:12+00:00

I am new to Codeigniter. I’m trying to create a simple customer database and

  • 0

I am new to Codeigniter. I’m trying to create a simple customer database and when it keeps trying to load my update_customer model It keeps giving me a Http error 500. I’m pretty sure I’ve narrowed it down to the model cause when I comment out the model call the page redirects it to itself with no error. Any ideas where my mistake was?

and I can’t seem to find the error in the apache error logs…

CONTROLLER:

function edit_customer($id){
    $data['success']=0;
    if($_POST){
        $data_customer=$_POST;
        $data_customer['active'] = 1;
        $this->customer->update_customer($id,$data);
        $data['success']=1;
    }
    $data['customer']=$this->customer->get_customer($id);

    $this->load->view('header');
    $this->load->view('edit_customer',$data);
    $this->load->view('footer');
}

MODEL:

function get_customer($id){
    $this->db->select()->from('customers')->where(array('active'=>1, 'id'=>$id))->order_by('date_added', 'desc');
    $query=$this->db->get();
    return $query->first_row('array');
}

function update_customer($id, $data){
    $this->where('id', $id);
    $this->db->update('customers', $data);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:08:14+00:00Added an answer on June 12, 2026 at 10:08 am

    Your missing a db-> in your where statement should be:

    function update_customer($id, $data){
        $this->db->where('id', $id);
        $this->db->update('customers', $data);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am still new into Codeigniter framework. Today I read about Database Caching http://codeigniter.com/user_guide/database/caching.html
I'm new to Codeigniter and I'm trying to develop a simple website with a
Possible Duplicate: Error : get property of non-object I am new to codeigniter model,
I'm brand new to CodeIgniter, and I'm trying to execute some simple examples in
I'm trying to create a universal header for a website built on CodeIgniter, and
I'm pretty new to codeigniter and I am trying to get to know databases
I'm new to codeigniter, and I'm trying to figure out how to implement a
I'm quite new to CodeIgniter and I'm trying to re-use the $data I pass
I'm new to CodeIgniter and I hope that my question will have a simple
i have download the new codeigniter 2.0 and put my controller,model and view files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.