![]() |
Stuffing array into active record insert - 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: Stuffing array into active record insert (/showthread.php?tid=4067) |
Stuffing array into active record insert - El Forum - 11-05-2007 [eluser]stevefink[/eluser] Hi all, I was just curious, is there a reason an Array with multiple elements is not properly being inserted using $this->db->insert with the Active Record class? Here's what my Array looks like: Code: DEBUG - 2007-11-05 11:20:32 --> testing for $p: Array And my PHP: Code: function insert_patient($p) { Thanks for any hints.. :-) Stuffing array into active record insert - El Forum - 11-05-2007 [eluser]gtech[/eluser] I would set $p to the following and see if that works (thats how I use the insert and it works for me). Code: ... Stuffing array into active record insert - El Forum - 11-05-2007 [eluser]Pygon[/eluser] the problem is that you have an array of arrays (multi-dimensional) as you can see, $p[0]['first_name'] = "Steve" where $p['first_name'] = "Steve" is expected. I would take a look at how you're creating the array. Stuffing array into active record insert - El Forum - 11-05-2007 [eluser]gtech[/eluser] lol, we both agree then ![]() |