Jump to content

php mysql_query and utf8 - problem


Zoranos

Recommended Posts

Hi, i dont know what to do, everything is ok in php, but when i query some values that have utf8 sign mysql server store this sings strange...

 

query('UPDATE clanstvo SET name='Špica' WHERE id=1'); // its ok in mysql

when debug and echo this query:

UPDATE clanstvo SET name='Špica' WHERE id=1

 

but when i look in phpmyadmin i see that has stored like: Špica

 

when i query back this value and echo in php its Špica again :S

 

but problem is that i use this database to connect web cms with game server(few) and that is problem... i only want that is stored like Špica in mysql...

 

after mysql_connect i have tryied mysql_set_charset('utf8'); and mysql_query('SET NAMES utf8'); and didnt helped...

 

does anyone have solution?

 

Link to comment
Share on other sites

The problem is likely NOT the database but the PHPMyAdmin web application is not displaying UTF8 characters correctly.

 

yes, i forund problem, htmlentities with utf8 was problem, i only switched to htmlspecialchars with utf8 and solved...stupid utf8 signs...

 

problem solved...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.