FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Encodings of Mysql and PHP files have to be same?





likeabreeze
the Encoding of Mysql and the encoding of php files have to be the same to function well?
What if they are different?
sonam
If encoding is not the same you can get bad results on your pages. But there is lot of text editors what have document encoding function. You can change encoding of each page (for example: UTF8 without BOM) and set Mysql on UTF8 unicode and I think this will work well (for me is working perfect).

Sonam
badai
yup, they got to be the same. otherwise your query might always return 0 result because it can't find column name, or you need to always query using *. then again, your "where" part in the query might become useless because it will never match.

also there are 2 enconding in mysql that you need to know:

1. the database itself
2. the "client connection"

you set your enconding when you create your database/write your php and for the "client connection" part you can set it by using mysql_set_charset()
Peterssidan
Many encodings (UTF-8, ISO 8859-1, etc.) are to great extent compatible with ASCII so you will probably not notice any problems with characters that exists in ASCII.
likeabreeze
When I opened my phpMyadmin to manage the mysql database, I found there are some messy codes.
But there is no messy codes on my website.
Could anyone tell me if there is something wrong with the encodings of the website and the database?
sonam
I have the same problem (Croatian charset) but as long are content OK I don' care. Wink

Sonam
Related topics
Help Needed Regarding CGI And Php
Seeking MySQL-php-Apache installer for WinXP
PHP DB Error: syntax error
Need some php/mysql dlls
Make your own PHP/APACHE/MySQL server at home.
How to create a php files that contain a image ?
MySQL, PHP and APACHE
PHP and MYSQL on the computer
The last foolish PHP/MySQL Question of the Year....
Is mySQL/php in safe mode on Frihosting?
Setting up a local PHP and MySQL Workspace
PHP and MySQL Books
PHP and MySQL Books
Need to find text in php files
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.