Configuring database encoding

Depending on the type of code used for your webpage, you should define the code for outgoing data from MySQL database.
If the same code is used for outgoing data as for your website, no anomalies will appear in characters with accents and other special symbols.
This is the usual way to connect to the MySQL database from your PHP script:


<?php
mysql_connect
('localhost','login','password');
mysql_select_db('database');
?>

Immediately after connecting, the code that you want to receive and enter data into the database needs to be set. The code in which the database itself runs is not important. (typically UTF-8).
Here are three mostly used character encoding systems in central Europe:

  • UTF-8 - recommended!
  • ISO-8859-2
  • WINDOWS-1250

For each of these encoding systems, we offer you start commands that have to be entered right after commands to connect to the database.UTF-8


<?php
mysql_query
('SET NAMES UTF8');
mysql_query('SET COLLATION_CONNECTION=UTF8_GENERAL_CI');
?>
ISO-8859-2

<?php
mysql_query
('SET NAMES LATIN2');
mysql_query('SET COLLATION_CONNECTION=LATIN2_GENERAL_CI');
?>
WINDOWS-1250

<?php
mysql_query
('SET NAMES CP1250');</
mysql_query('SET COLLATION_CONNECTION=CP1250_GENERAL_CI');
?>

helpdesk

we are ready to serve

currently online

agents online 2 / 6

Platon Technologies

How can we help you?

We accept reports of problems or other inducements related to the use of our products and services.

 

helpdesk@platon.net +421 222 111 321

In case you need any help, contact us by e-mail or by phone.

  • On the phone from 8:30 - 17:30
  • Sometimes even on weekends
  • Simple human approach
  • Complex problems solving
contact form

Give a chance to our online help-center. You can find there more than:

  • 6 categories
  • 59 manuals
  • 23 e-mail settings
  • 7 programming tips
go to counseling

Questions about our products or any specific request? Contact us.

Thanks for message

If necessary, we will contact you.

Send of message failed

Please contact us at helpdesk@platon.net.

NEWSLETTER

Subscribe to receive our news and current offers

Thanks for your subscribe

Subscribtion has failed