mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
sqlite support UNION ALL SELECT method
git-svn-id: file:///svn/phpbb/trunk@4203 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -201,13 +201,16 @@ if (isset($_POST['start']) || isset($_GET['batchstart']))
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
$value_sql .= (($value_sql != '') ? ', ' : '') . '(\'' . $word[$i] . '\')';
|
||||
$value_sql .= (($value_sql != '') ? ', ' : '') . "('" . $word[$i] . "')";
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'sqlite':
|
||||
$value_sql .= (($value_sql != '') ? ' UNION ALL ' : '') . "SELECT '" . $word[$i] . "'";
|
||||
break;
|
||||
|
||||
default:
|
||||
$sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text)
|
||||
$sql = 'INSERT INTO ' . SEARCH_WORD_TABLE . " (word_text)
|
||||
VALUES ('" . $word[$i] . "')";
|
||||
$db->sql_query($sql);
|
||||
break;
|
||||
@@ -221,11 +224,13 @@ if (isset($_POST['start']) || isset($_GET['batchstart']))
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
$sql = "INSERT IGNORE INTO " . SEARCH_WORD_TABLE . " (word_text)
|
||||
$sql = 'INSERT IGNORE INTO ' . SEARCH_WORD_TABLE . " (word_text)
|
||||
VALUES $value_sql";
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
$sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text)
|
||||
case 'sqlite':
|
||||
$sql = 'INSERT INTO ' . SEARCH_WORD_TABLE . " (word_text)
|
||||
$value_sql";
|
||||
break;
|
||||
}
|
||||
@@ -240,7 +245,7 @@ if (isset($_POST['start']) || isset($_GET['batchstart']))
|
||||
|
||||
if ($match_sql != '')
|
||||
{
|
||||
$sql = "INSERT INTO " . SEARCH_MATCH_TABLE . " (post_id, word_id, title_match)
|
||||
$sql = 'INSERT INTO ' . SEARCH_MATCH_TABLE . " (post_id, word_id, title_match)
|
||||
SELECT $post_id, word_id, $title_match
|
||||
FROM " . SEARCH_WORD_TABLE . "
|
||||
WHERE word_text IN ($match_sql)";
|
||||
|
Reference in New Issue
Block a user