arabic - Non-English characters count more with MySQL VARCHAR? -
doesn't varchar(15) mean can have 15 characters in field? if so, why getting 'data long' error?
i insert data 123456789 no problem,
but ١٢٣٤٥٦٧٨٩
data long column 'customer_phone' @ row 1
they have same number of characters!
my table definition (partly):
+-------------------+---------------+------+-----+-------------------+--------------+ | field | type | null | key | default | | +-------------------+---------------+------+-----+-------------------+---------------+ | id | int(11) | no | pri | null | auto_increment| | customer_id | int(11) | no | mul | null | | | customer_name | varchar(75) | yes | | null | | | customer_phone | varchar(15) | yes | | null | | | paid_amount | decimal(10,2) | no | | null | | | paid_currency | varchar(4) | no | mul | null | | | ex_rate | decimal(8,2) | no | | null | | | date_time | datetime | no | mul | current_timestamp | | | is_virtual | tinyint(1) | no | | 0 | | +-------------------+---------------+------+-----+-------------------+---------------+
find character set , make sure set utf8.
to add follwing my.cnf file
[client] default-character-set=utf8 [mysql] default-character-set=utf8 [mysqld] collation-server = utf8_unicode_ci init-connect='set names utf8' character-set-server = utf8
Comments
Post a Comment