All pastes #766612 Raw Edit

Mine

public php v1 · immutable
·published 2007-11-09 00:05 UTC
rendered paste body
		//-----------------------------------------		// Add db index tables		//-----------------------------------------				$this->ipsclass->DB->query("DESCRIBE " . SQL_PREFIX . "attachments");		$sql = $this->ipsclass->DB->simple_exec();		$queries = array();				while ( $data = $this->ipsclass->DB->fetch_row( $sql ) )		{			if ( $data['Field'] == 'attach_file' AND $data['Key'] != 'MUL' )			{				$queries[] = "ALTER TABLE " . SQL_PREFIX . "attachments ADD INDEX ( attach_file )";			}						if ( $data['Field'] == 'torrent_id' AND $data['Key'] != 'MUL' )			{				$queries[] = "ALTER TABLE " . SQL_PREFIX . "attachments ADD INDEX ( torrent_id )";			}		}		foreach ($queries as $query)		{			$this->ipsclass->DB->query($query);		}