public function getPrimaryKey($table) { $table = $this->quoteIdentifier($table); $stmt = $this->_pdo->query("SHOW KEYS FROM {$table} WHERE Key_name = 'PRIMARY'"); $result = $stmt->fetch(); return $result['Column_name']; }