Welcome Guest, Not a member yet? Register   Sign In
insert_id not working
#11

[eluser]Fred Riley[/eluser]
Thanks to all for the replies. I do call insert_id() after the insert operation, in a view after the controller to add a new user record is run. This is using ion-auth - the user fills in a registration form, on submit that form runs a controller to insert a user, then calls a view to tell the user that s/he's registered ok and showing them their details. The row is definitely inserted because I see it in the table, and affected_rows() returns 1.

The call to insert_id() worked fine in a previous application I developed in CI 1.7, identical code, which is why I was so surprised that it falls over in my latest app. The user table being inserted into does have an auto-increment primary key.

It's all a bit of a mystery, but maybe it's an ion-auth thing. I'll have to check it after the weekend.

Fred


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



Theme © iAndrew 2016 - Forum software by © MyBB