problem appending to table |
I am writing out 10 records in a loop. This is how I am trying to write out:
PHP Code: $data = array(
proof that an old dog can learn new tricks
@richb201,
Maybe because it has to do with your call. Here is the link to the documentation ( https://codeigniter.com/user_guide/datab...rting-data ). I noticed that you used $this->db->insert_string instead of $this->db->insert.
That was it! How stupid of me. I tried it again and now remember why I switched over to insert_string. The following command causes my phpStorm to stop working:
$this->db->insert('activity_log',$data); I ran again, this time w/o the debugger running and then checked out the activity_log table with phpMyAdmin. The record(s) is NOT being written out. Is insert or insert_string the wrong command to be using?
proof that an old dog can learn new tricks
I fixed it. Turns out that I had not set the id column to be auto increment. So there were two id's that were=0. I purged the table and then modified the structure, and all seems AOK now. Thanks.
proof that an old dog can learn new tricks
I always add an id column to all of my tables that is auto incremented.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |