core/MY_Model.php
private function _fetch_primary_key()
    {
        if($this->primary_key == NULl)
        {
            $this->primary_key = $this->_database->query("SHOW KEYS FROM `".$this->_table."` WHERE Key_name = 'PRIMARY'")->row()->Column_name;
        }
    }
private function _fetch_primary_key()
    {
        if($this->primary_key == NULl)
        {
            $this->primary_key = $this->_database->query("SHOW KEYS FROM `".$this->_table."` WHERE Key_name = 'PRIMARY'")->row()->Column_name;
        }
    }
private function _fetch_primary_key ( ) { if ( $ this -> primary_key == NULl ) { $ this -> primary_key = $ this -> _database -> query ( "SHOW KEYS FROM `" . $ this -> _table . "` WHERE Key_name = 'PRIMARY'" ) -> row ( ) -> Column_name ; } }
Guess the primary key for current table
Guess the primary key for current table