Welcome Guest, Not a member yet? Register   Sign In
Database field_data
#1

I recently had a situation where I needed to know if a column was an auto incremented field.  I was using primary_key, but discovered that something can be primary_key and not auto increment ;-)

I have provided my own implementation from the mysql_result by putting it in MY_Model class and added this property:

PHP Code:
$F->auto_increment strripos($field -> Extra'auto_increment') !== FALSE 0

It would be very helpful to have this become part of the standard field_data in a future version of CI.
Reply
#2

(This post was last modified: 01-30-2015, 09:04 AM by Narf.)

You'll discover many more things like that in the future ... including that AUTO_INCREMENT is a MySQL-specific feature, and as such is not suitable for inclusion in the otherwise platform-agnostic DB layer that CodeIgniter has.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB