[SOLVED] can't save transaction without details |
[eluser]theprodigy[/eluser]
show me the errors you are getting, and the save_detail method in your Main_company_db, and I will look at it tomorrow. It is late and I have work to do in the morning.
[eluser]maria clara[/eluser]
[quote author="theprodigy" date="1265375150"]show me the errors you are getting, and the save_detail method in your Main_company_db, and I will look at it tomorrow. It is late and I have work to do in the morning.[/quote] here's my error: Quote:<p>Severity: Notice</p> and here is the save for the main_company_db: Code: function save($data,$item) there's no save_detail in my main_company_db thanks in advance, kahtrina
[eluser]theprodigy[/eluser]
Quote:Message: Undefined property: Sec_users::$Main_company_db Quote:$this->load->model('Dataset_db'); Quote:and while the sec_companyaccess_db and the maint_company_db is for my detail grid.. Quote:there’s no save_detail in my main_company_db Quote:$data['item'] = $this->Main_company_db->save_detail($id,$item); based on these quotes, you need to make a couple of changes: 1. is it "Main_company_db" or "maint_company_db"? 2. save_detail($id,$item) does not exist in your maint_company_db, but you are calling it.
[eluser]maria clara[/eluser]
Quote:based on these quotes, you need to make a couple of changes: i used the Main_company_db because it is what being loaded in my Main_company.php and i change the save_detail($id,$item) to save($id,$item). but i also tried to load two models in one controller but it says that it unable to locate the Main_company_db. is it possible to load two models in the same controller??? my Main_company_db came from another Module for company details only..
[eluser]maria clara[/eluser]
i have changed my code and i have this error shown in my console: Quote:<h1>A Database Error Occurred</h1> here's my new code for my controller: Code: case $crudConfig['create']: i have made changes like i created a savecompany_details function and i call the getCompanyDetails funtion for my controller. and im loading the User model. and here's my code for my model: Code: function savecompany_details($id,$rows) thanks for replies.. thanks in advance, kahtrina
[eluser]maria clara[/eluser]
hi, i got this message in my console when i tried to add details in my detail grid and when i refresh it. it doesn't showing the data i added. my console message was this: Quote:POST http://localhost/comunion/sec_users/detailpost and i also changed again my code: CONTROLLER: Code: case $crudConfig['create']: MODEL: Code: function savecompany_details($id) thanks in advance, kahtrina
[eluser]theprodigy[/eluser]
Quote:POST http://localhost/comunion/sec_users/detailpostWhere are you calling ob_start()? Quote:foreach ($fields as $field)What's the point of the foreach loop? Quote:function savecompany_details($id)you might want to comment out the where function as well.
[eluser]maria clara[/eluser]
[quote author="theprodigy" date="1265622040"] foreach ($fields as $field) {if (isset($_POST[$field])) $id[$field] = $this->input->post($field);} $id = $this->input->post("ids"); $data['item'] = $this->User->savecompany_details($id); [/quote] this is for when you are adding new data. if the condition above fails it continue to the foreach loop [/quote] i have commented the where as you've said. Code: function savecompany_details($id) and my console show me this: Quote:Arraybecause i have changed my code: Code: print_r($_POST); // i put this to see what happen to $id
[eluser]theprodigy[/eluser]
$data['id'] is not getting populated because your savecompany_details($id) function in your model is not returning anything. As for $_POST['id'], I'm not sure why it's not populated. Is it maybe supposed to be auto-incremented in the database and therefore not supposed to be filled in the $_POST array?
[eluser]maria clara[/eluser]
[quote author="theprodigy" date="1265628223"]$data['id'] is not getting populated because your savecompany_details($id) function in your model is not returning anything. As for $_POST['id'], I'm not sure why it's not populated. Is it maybe supposed to be auto-incremented in the database and therefore not supposed to be filled in the $_POST array?[/quote] yeah you're right it should be/ was really auto-incremented. i changed again my code to this: CONTROLLER: Code: case $crudConfig['create']: MODEL: Code: function savecompany_details($id) still i have this: Quote:Array |
Welcome Guest, Not a member yet? Register Sign In |