//----------------------------------------- // Add db index tables //----------------------------------------- $this->ipsclass->DB->query("DESCRIBE " . SQL_PREFIX . "attachments"); $sql = $this->ipsclass->DB->simple_exec(); $results = $this->ipsclass->DB->fetch_rowset( $sql ); foreach ($resuls as $data) { if ( $data['Field'] == 'attach_file' AND $data['Key'] != 'MUL' ) { $this->ipsclass->DB->query("ALTER TABLE " . SQL_PREFIX . "attachments ADD INDEX ( attach_file )"); } if ( $data['Field'] == 'torrent_id' AND $data['Key'] != 'MUL' ) { $this->ipsclass->DB->query("ALTER TABLE " . SQL_PREFIX . "attachments ADD INDEX ( torrent_id )"); } }