src/Model3/Db/Table.php
protected function describe()
	{
		if(is_null($this->_tableName) == false)
		{
			$this->_query = 'DESCRIBE '.$this->_tableName;
            if($this->_db->execute($this->_query) !== false)
			{
				$res = $this->_db->getAllRows();
                unset($this->_fields);
                unset($this->_primaryKey);
                $this->_fields = array();
                foreach($res as $r)
                {
                    $this->_fields[] = $r['Field'];
                    if($r['Key'] == 'PRI')
                    	$this->_primaryKey = $r['Field'];
                }
				return true;
			}
		}
		return false;
	}
protected function describe()
	{
		if(is_null($this->_tableName) == false)
		{
			$this->_query = 'DESCRIBE '.$this->_tableName;
            if($this->_db->execute($this->_query) !== false)
			{
				$res = $this->_db->getAllRows();
                unset($this->_fields);
                unset($this->_primaryKey);
                $this->_fields = array();
                foreach($res as $r)
                {
                    $this->_fields[] = $r['Field'];
                    if($r['Key'] == 'PRI')
                    	$this->_primaryKey = $r['Field'];
                }
				return true;
			}
		}
		return false;
	}
protected function describe ( ) { if ( is_null ( $ this -> _tableName ) == false ) { $ this -> _query = 'DESCRIBE ' . $ this -> _tableName ; if ( $ this -> _db -> execute ( $ this -> _query ) !== false ) { $ res = $ this -> _db -> getAllRows ( ) ; unset ( $ this -> _fields ) ; unset ( $ this -> _primaryKey ) ; $ this -> _fields = array ( ) ; foreach ( $ res as $ r ) { $ this -> _fields [ ] = $ r [ 'Field' ] ; if ( $ r [ 'Key' ] == 'PRI' ) $ this -> _primaryKey = $ r [ 'Field' ] ; } return true ; } } return false ; }
for now, this method is intended just for tables with one primary key
for now this method is intended just for tables with one primary key