insert data didn't work - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: insert data didn't work (/showthread.php?tid=19928) |
insert data didn't work - El Forum - 06-23-2009 [eluser]yudahebat[/eluser] I have a function like this Code: $data1 = array Code: 'biaya_total' => $this->db->select_sum('subtotal'); insert data didn't work - El Forum - 06-23-2009 [eluser]Dam1an[/eluser] a) What does the error say? b) You seem to have a semi colon on the last 2 lines in the array, that can't help c) Do you really want the query object in the array? And if so, you might want to specify a key for it insert data didn't work - El Forum - 06-23-2009 [eluser]yudahebat[/eluser] a) the error said Code: Parse error: syntax error, unexpected ';', expecting ')' in C:\xampp\htdocs\CI2\system\application\models\crud.php on line 368 c) yes i want,how to make it? insert data didn't work - El Forum - 06-23-2009 [eluser]Thorpe Obazee[/eluser] [quote author="yudahebat" date="1245767939"]a) the error said Code: Parse error: syntax error, unexpected ';', expecting ')' in C:\xampp\htdocs\CI2\system\application\models\crud.php on line 368 c) yes i want,how to make it?[/quote] b. Wasn't what obvious from the error? yudahebat, you could start by reading the user guide and php.net. Honestly, almost all posts made by yudahebat have been, "How would you do this? How would you do that?", when most of these things can be understood from the user_guide. The others are just plain basic PHP.Another thing I've noticed is that he/she copies and pastes code without understanding what it actually does. 2 cents. don't mind me. insert data didn't work - El Forum - 06-23-2009 [eluser]Phil Sturgeon[/eluser] Although I can't really see why you would want to send the query object in there, if you DID want to the syntax would be done like this. Code: $data1 = array What are you trying to achieve with this? The query will not be stored correctly at all... insert data didn't work - El Forum - 06-23-2009 [eluser]Thorpe Obazee[/eluser] [quote author="yudahebat" date="1245763722"]I have a function like this Code: $data1 = array Code: $this->db->select_sum('subtotal'); Someone probably copied and pasted Code: $this->db->select_sum('subtotal'); And thought it would work correctly. insert data didn't work - El Forum - 06-24-2009 [eluser]yudahebat[/eluser] what do u mean someone? I dont understand... I just want to get the value of Code: $this->db->select_sum('subtotal'); how to make it? insert data didn't work - El Forum - 06-24-2009 [eluser]Phil Sturgeon[/eluser] Code: $this->db->select_sum('subtotal'); It is all in here dude. |