End of part 3 of patch #458014: fulltext indexes support

This commit is contained in:
Loïc Chapeaux
2001-09-06 23:48:51 +00:00
parent e393a2f2d7
commit 709eec1b9b
4 changed files with 60 additions and 6 deletions

View File

@@ -124,6 +124,21 @@ if (isset($submit)) {
}
} // end if
// Builds the fulltext statements and updates the table
$fulltext = '';
if (MYSQL_INT_VERSION >= 32323 && isset($field_fulltext)) {
for ($i = 0; $i < count($field_fulltext); $i++) {
$j = $field_fulltext[$i];
$fulltext .= backquote($field_name[$j]) . ', ';
} // end for
$fulltext = ereg_replace(', $', '', $fulltext);
if (!empty($fulltext)) {
$sql_query .= "\n" . 'ALTER TABLE ' . backquote($db) . '.' . backquote($table) . ' ADD FULLTEXT (' . $fulltext . ')';
$result = mysql_query('ALTER TABLE ' . backquote($db) . '.' . backquote($table) . ' ADD UNIQUE (' . $fulltext . ')') or mysql_die();
}
} // end if
// Go back to table properties
$message = $strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenAltered;
include('./tbl_properties.php3');