我有一个使用 SMF 的新论坛,我现在正在尝试将数据库转换为 UTF-8。SMF 提供了一种简单的方法来做到这一点,但是这样做时,我得到了这个奇怪的听起来错误:
you have an error in your sql syntax; check the manual that corresponds to your mariadb server version for the right syntax to use near 'before before blob not null,
change column after after blob not null,
...' at line 6
file: /home/halfmoon/public_html/sources/managemaintenance.php
line: 664
我是编码的新手,尤其是在涉及 SQL 时,所以我对错误的含义一无所知,除了在哪里找到它并且该行不正确。如果需要,我也可以在此处复制并粘贴该行的全文 - 不确定需要什么!:
第 664 行从“updates_blob”开始</p>
SQL版本:
“ // 将列更改为二进制形式。$smcFunc['db_query']('', ' ALTER TABLE {raw:table_name}{raw:updates_blob}', array('table_name' => $table_info['Name'], 'updates_blob' => substr($updates_blob , 0, -1), ) );
MariaDB 版本:
// Convert the character set if MySQL has no native support for it.
if (isset($translation_tables[$_POST['src_charset']]))
{
$update = '';
foreach ($table_charsets as $charset => $columns)
foreach ($columns as $column)
$update .= '
' . $column['Field'] . ' = ' . strtr($replace, array('%field%' => $column['Field'])) . ',';
$smcFunc['db_query']('', '
UPDATE {raw:table_name}
SET {raw:updates}',
array(
'table_name' => $table_info['Name'],
'updates' => substr($update, 0, -1),
)
);
}port for it.”