Raised This Month: $ Target: $400
 0% 

[SOLVED] [SQL] problem with specific caracter


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 07-09-2012 , 10:48   [SOLVED] [SQL] problem with specific caracter
Reply With Quote #1

Hello,

I'm looking to insert some data in SQL,

my .sp is encoded in ut8 without BOM,
my database is encoded in utf8_generals_ci, and it don't work.

Can anyone help me ?
__________________
Sorry for my bad English, I'm Belgian

Last edited by Razmo51; 07-10-2012 at 12:12.
Razmo51 is offline
delachambre
AlliedModders Donor
Join Date: Jan 2011
Location: France
Old 07-09-2012 , 11:56   Re: [SQL] problem with specific caracter
Reply With Quote #2

Problem on insert a pseudo of player's in DB ?
__________________
♥ 𝕊ℙ𝕒𝕨𝕟 𝔻𝕖𝕧𝕖𝕝𝕠𝕡𝕖𝕣 [ℂ𝕊:𝕊] ♥

Clan-Nemesis
delachambre is offline
unt0uch4bl3
Junior Member
Join Date: Apr 2009
Old 07-09-2012 , 12:07   Re: [SQL] problem with specific caracter
Reply With Quote #3

If you are using MYSQL, you may need to execute this query after connecting to the database:

Code:
FormatEx(query, sizeof(query), "SET NAMES \"UTF8\"");
unt0uch4bl3 is offline
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 07-09-2012 , 12:19   Re: [SQL] problem with specific caracter
Reply With Quote #4

PHP Code:
 new String:g_charset[600];
        
Format(g_charsetsizeof(g_charset), "SET NAMES 'utf8'");
        
        
SQL_FastQuery(g_hBddg_charset);
        
        new 
String:g_insertquery[600];
        
Format(g_insertquerysizeof(g_insertquery), "INSERT INTO `logs_web_full` (`prefix` ,`heure` ,`joueur` ,`cmd`) VALUES ('%s',  '%s', '%s', '%s')"prefixTimeid,cmd);
        
        
SQL_FastQuery(g_hBddg_insertquery); 
when I print my queries, specific caracter are good, but in the SQL, the result are bad

(I use MYSQL)

EDIT: fixed
__________________
Sorry for my bad English, I'm Belgian

Last edited by Razmo51; 07-09-2012 at 12:26.
Razmo51 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode