[eluser]whobutsb[/eluser]
Hello all I'm using a MSSQL DB for my application and I was wondering if there was a simple way of returning the newly inserted key after I do my insert command.
In CI I'm using this code:
Code:
$data = array('contactID' => $contactID, 'fieldcategoryID' => $fieldcategoryID, 'field_name'=>$fieldname, 'field_value'=>$fieldvalue);
$add = $this->db->insert_string('tblContactDetails', $data);
I was wondering if there was a helper method to return the newly inserted key in the database?
Usually I would write my SQL code as follow
INSERT INTO table (fields, fields, fields)
OUTPUT Inserted.ID
VALUES (Value1, Value2, Value3)
Then using a php mssql_result get the newly inserted ID.
Thanks for the help!
Steve