[eluser]codemonkey[/eluser]
[quote author="GrahamDj28" date="1336084875"]If you update a record, then the ID is already known.
How else would you update the correct record?
And as the name implies, it returns the record ID on an insert. Not on an update[/quote]
I see why it wouldn't work.
How can I grab the ID from a loop that checks to see if a value is already in the db?
Example:
Code:
$q = $this
->db
->where('item_num', $num_to_check)
->limit(1)
->get('items');
if ( $q->num_rows == 1) {
//then UPDATE
}
//add