![]() |
[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-07-2010 [eluser]theprodigy[/eluser] Quote:case $crudConfig['create']: Quote:function savecompany_details($id) [SOLVED] can't save transaction without details - El Forum - 02-08-2010 [eluser]maria clara[/eluser] [quote author="theprodigy" date="1265629022"] Quote:case $crudConfig['create']: Quote:function savecompany_details($id)[/quote] yeah, i thought so.. but when i put return $id; in my savecompan_details() function it doesn't have any changes. i figuring where i gone wrong??? [SOLVED] can't save transaction without details - El Forum - 02-08-2010 [eluser]theprodigy[/eluser] Code: function savecompany_details($id) but, you are going to have a hard time getting one, with trying to insert a null record (unless every field in your database is set to allow null - other then the id which is auto incremented) [SOLVED] can't save transaction without details - El Forum - 02-08-2010 [eluser]maria clara[/eluser] [quote author="theprodigy" date="1265630891"] Code: function savecompany_details($id) but, you are going to have a hard time getting one, with trying to insert a null record (unless every field in your database is set to allow null - other then the id which is auto incremented)[/quote] i have tried and put the code as you said and i notice something in the console Quote:Array is it now adding?? i looked at the structure of my db table maint_company and noticed that it doesn't have allowing a null value in every field. [SOLVED] can't save transaction without details - El Forum - 02-08-2010 [eluser]theprodigy[/eluser] the way to see if it's adding is to check the database records, not the database structure. To get the information posted to be inserted into the database, you need to pass the information to your savecompany_details method. There is no need to pass the id, as it will be empty at the time of passing the info. Just pass the other info Code: case $crudConfig['create']: Code: function savecompany_details($id) [SOLVED] can't save transaction without details - El Forum - 02-08-2010 [eluser]maria clara[/eluser] it shows me a parse error like this Quote:Parse error: parse error in C:\xampp\htdocs\comunion\system\application\modules\sec_users\controllers\sec_users.php on line 554 every time i commented this block of codes: Code: case $crudConfig['create']: the commented block of code shows me a parse error. but when i uncommented it it works well but still don't show the data im adding. [SOLVED] can't save transaction without details - El Forum - 02-08-2010 [eluser]theprodigy[/eluser] Code: case $crudConfig['create']: [SOLVED] can't save transaction without details - El Forum - 02-08-2010 [eluser]maria clara[/eluser] it has a parse error and it pertains to your script at this line: Quote:Parse error: parse error in C:\xampp\htdocs\comunion\system\application\modules\sec_users\controllers\sec_users.php on line 566 Code: if (isset($_POST[$field])) [SOLVED] can't save transaction without details - El Forum - 02-08-2010 [eluser]theprodigy[/eluser] Quote:it has a parse error and it pertains to your script at this line: that's actually your script. I just reformatted it. It's the same script as Quote:{if (isset($_POST[$field])) $id[$field] = $this->input->post($field);} Try changing your entire else block to something like: Code: else [SOLVED] can't save transaction without details - El Forum - 02-08-2010 [eluser]maria clara[/eluser] i have changed my code and still trying to update it to solve my problem.. here's my controller: Code: case $crudConfig['create']: here's my model: Code: function savecompany_details($id) //Query for saving the company i think its already adding but it just don't posting the value of the item. because i have this: Quote:Array |