![]() |
[SOLVED] can't save transaction without details - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: [SOLVED] can't save transaction without details (/showthread.php?tid=27165) |
[SOLVED] can't save transaction without details - El Forum - 02-09-2010 [eluser]theprodigy[/eluser] when you post the new company that is created, is it possible to also post the user_id, so that you can populate the sec_companyaccess table as well? That will solve all your problems. If you are creating a new user, then the only option I can come up with is to create a blank user row, and return the new user_id, then send to an edit form (thus having blank form fields, but already having a user_id). Otherwise, you may have to re-work your site to the way I described before (create a company elsewhere, use the user-form to just assign the company to them - using a drop down to assign the company, or checkboxes to allow assigning multiple). [SOLVED] can't save transaction without details - El Forum - 02-09-2010 [eluser]maria clara[/eluser] how can i save the Company_code and company_name in Maint_company table and how can i get the company_id to be put in the sec_companyaccess table??? am thinking if i should put it here: Code: function savecompany_details($id) //Query for saving the company [SOLVED] can't save transaction without details - El Forum - 02-09-2010 [eluser]theprodigy[/eluser] Quote:how can i save the Company_code and company_name in Maint_company table and how can i get the company_id to be put in the sec_companyaccess table???Yes, return $this->db->insert_id() (like you are doing) will return the company_id [SOLVED] can't save transaction without details - El Forum - 02-09-2010 [eluser]maria clara[/eluser] [quote author="theprodigy" date="1265790994"] Yes, return $this->db->insert_id() (like you are doing) will return the company_id[/quote] yes, i see its returning the company_id. but what i want is to put the company_id to the sec_companyaccess table for it to be posted in the jquery grid. like while it is saving in the maint_company table that it will also save the company_id in the sec_companyaccess table [SOLVED] can't save transaction without details - El Forum - 02-09-2010 [eluser]theprodigy[/eluser] as I was trying to say earlier, if you have the user_id at that time, you can also save the data in the sec_companyaccess table. But if you don't then you will run into problems as both the company_id AND the user_id are required. [SOLVED] can't save transaction without details - El Forum - 02-09-2010 [eluser]maria clara[/eluser] [quote author="theprodigy" date="1265791916"]as I was trying to say earlier, if you have the user_id at that time, you can also save the data in the sec_companyaccess table. But if you don't then you will run into problems as both the company_id AND the user_id are required.[/quote] i got the logic.. i will have the user_id and company_id in the sec_companyaccess table when i submit the save button above the fields, but the problem is.. i wasn't able to post the company details in the jquery grid first. because if i have successfully have done that.. i will be able to save the user_id and company_idin the sec_companyaccess table. so, my real problem is to post the company details in the jquery grid. [SOLVED] can't save transaction without details - El Forum - 02-09-2010 [eluser]theprodigy[/eluser] Quote:so, my real problem is to post the company details in the jquery grid.which you cannot do without the user_id [SOLVED] can't save transaction without details - El Forum - 02-09-2010 [eluser]saidai jagan[/eluser] WoW... a Thread consisting of 6 pages and still not ended ![]() Thanks guyz for u r Helps. [SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]maria clara[/eluser] hi again to all, i was able to populate the row in mt console like this: Quote:{ but i have this also in my console: Quote:{"item":null}<br /> here's my new code in CONTROLLER: Code: case $crudConfig['create']: and in my MODEL: Code: function save_companydetail($details,$id) it was populating but i still it wasn't posting. regards, kahtrina [SOLVED] can't save transaction without details - El Forum - 02-14-2010 [eluser]theprodigy[/eluser] I'm assuming this is still on saving the new company through the jquery grid. when submitting the add company form, does it contain the user id in a hidden field with the name "item"? Or, it doesn't even have to be a hidden field. Basically, are you submitting a form field, with the name "item" along with the rest of the form (company_name, company_code)? |