insert_id not working |
[eluser]Fred Riley[/eluser]
I've a feeling that this question will result in a D'OH!! but it's late at night, I've spent two hours on this problem and I need my beauty sleep. My problem is that I can't get the simple insert_id() to work, eg: $user_id = $this ->db->insert_id(); A user registers (I'm using ion-auth), the row in the users table is inserted, but insert_id stubbornly returns 0 no matter what the key of the inserted row. Other query helper functions work, eg: $rows = $this->db->affected_rows(); This returns 1 after the operation, as you'd expect. The database library is autoloaded. I've read TFM on Active Record and Query Helper. I've searched the forum but could only find one maybe relevant thread which doesn't have the answer. All I'm after doing is getting basic details of the user just registered to display. Two questions: 1. What am I doing wrong, or missing? 2. Is the query helper integral to CI or does it have to be loaded? Thanks in advance ![]() Fred PS: In a previous application written in CI 1.7 insert_id worked fine. |
Messages In This Thread |
insert_id not working - by El Forum - 01-24-2013, 03:45 PM
insert_id not working - by El Forum - 01-24-2013, 04:44 PM
insert_id not working - by El Forum - 01-24-2013, 05:07 PM
insert_id not working - by El Forum - 01-24-2013, 08:39 PM
insert_id not working - by El Forum - 01-24-2013, 10:53 PM
insert_id not working - by El Forum - 01-24-2013, 11:00 PM
insert_id not working - by El Forum - 01-24-2013, 11:03 PM
insert_id not working - by El Forum - 01-24-2013, 11:44 PM
insert_id not working - by El Forum - 01-25-2013, 01:24 AM
insert_id not working - by El Forum - 01-25-2013, 02:33 AM
insert_id not working - by El Forum - 01-25-2013, 02:44 AM
insert_id not working - by El Forum - 01-25-2013, 03:14 AM
insert_id not working - by El Forum - 01-25-2013, 09:59 AM
insert_id not working - by El Forum - 01-25-2013, 11:35 PM
insert_id not working - by El Forum - 01-28-2013, 03:03 PM
insert_id not working - by El Forum - 01-28-2013, 03:08 PM
insert_id not working - by El Forum - 01-28-2013, 06:27 PM
|