|
楼主 |
发表于 2008-1-30 12:54:34
|
显示全部楼层
来自 中国–广东–东莞
回复: war3ft v3.0_RC8,RC9汉化版的错误提示。
Post by zwfgdlc
mysql的问题,mysql对特殊字符支持不是很好,所以会出现此问题.
修改下源码把所有像这样的SQL语句都修改下,
SELECT `player_id` FROM `wc3_player` WHERE `player_name` = '|'ppo';
改成这样:
SELECT `player_id` FR... [PHP]SQLITE_FetchUniqueID( id )
{
// Make sure our connection is working
if ( !SQLITE_Check_Connection() )
{
return;
}
// Remember how we got this ID
g_iDBPlayerSavedBy[id] = get_pcvar_num( CVAR_wc3_save_by );
new szKey[66], szKeyName[32];
DB_GetKey( id, szKey, 65 );
DB_GetKeyName( szKeyName, 31 );
new szQuery[512];
format( szQuery, 511, "SELECT `player_id` FROM `wc3_player` WHERE `%s` = '%s';", szKeyName, szKey );
new Handle:query = SQL_PrepareQuery( g_DBConn, szQuery );
if ( !SQL_Execute( query ) )
{
SQLITE_Error( query, szQuery, 4 );
return;
}
// If no rows we need to insert!
if ( SQL_NumResults( query ) == 0 )
{
// Free the last handle!
SQL_FreeHandle( query );
// Insert this player!
new szQuery[512];
format( szQuery, 511, "INSERT INTO `wc3_player` ( `player_id` , `%s` , `time` ) VALUES ( NULL , '%s', julianday('now') );", szKeyName, szKey );
new Handle:query = SQL_PrepareQuery( g_DBConn, szQuery );
if ( !SQL_Execute( query ) )
{
SQLITE_Error( query, szQuery, 5 );
return;
}
g_iDBPlayerUniqueID[id] = SQL_GetInsertId( query );
}
// They have been here before - store their ID
else
{
g_iDBPlayerUniqueID[id] = SQL_ReadResult( query, 0 );
}
// Free the last handle!
SQL_FreeHandle( query );
}[/PHP]
format( szQuery, 511, "SELECT `player_id` FROM `wc3_player` WHERE `%s` = '%s';", szKeyName, szKey );
好像没什么问题,请问该怎么改呢? |
|