Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




How To Save Chinese Record In MySQL?


I am now using MySQL database to save Chinese, my OS if Chinese Windows2000, and my MYSQL version is 4.2, but I couldn't save some Chinese characters at all, some can be saved, others are lost or displayed in a mass, you won't understand the meaning at all.
Can anyone tell me how to solve this problem, how to save Chinese informaiton in MySQL?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Save Picture Files (.jpg) In Database Records Or Save Only Links To (.jpg)
I dont know what is more eficient. What do you think is better, put in pictures physically in records in database or put in links to pictures in records?

Chinese/Unicode From Php And Mysql
I searched the forum regarding this problem already and attempted to solve the problem, but fail regardlessly.I entered chinese characters directly into a table column A which has collation utf8_unicode_ci using phpmyadmin. The chinese/unicode characters actually appeared in phpmyadmin's "select * from tableT".

However, when I create a php script with a query "select * from tableT", it appears in the form of question marks e.g. ????.Any idea how to resolve this? If I can view the chinese characters in phpmyadmin via the web browser, it shouldn't be a problem to display it in a php file, right? Not sure whether this is a php or a mysql problem.

Store Chinese Character In Mysql
My site is 90% english, however there are some pages that i need to display in chinese character. In fact, arabic, russia, spanish. In mysql, i try to use collation utf8_general_ci . So when i input the data using phpmyadmin, i type chinese character e.g •Ÿ(lucky) into the record, save it. Unfortunately when i use php to get the data from mysql database and present it on the web, it appear as '?' (question mark). How do i show it on the web correctly ?

Is MYSQL Supports Chinese Language
Is Mysql support chinese language or not.

The Most Optimize Way To Store And Seach Chinese Character In MySQL 4.1
Currently i store the chinese character in unicode decimal format
(&#<number>;). In this way, I can display and search the chinese
character correctly. However, this will take more storage space. Is
this the most optimize way?

How To Store Chinese Chars And Also Italian, French And English In Mysql ?
I'm not able to store chinese characters into a column in a table....

how should the db setted and the table created to be able to store
different chars like chinese, french, italian and english ?

Mysql Save
after install mysql, is my mysql save? how to make my more mysql save after install?

How Do I Save A Mysql File
How do we save sql files? well i'm new to them and wanted toknow how.

Can I Save Newline As Data In Mysql DB?
I am using php with mysql. I am updating a record in a table. The existing record is 'hello' for examples. I am updating this record to be 'hello
you'. But after running the updating using UPDATE my_table SET myrecord = $record, and $record is 'hello
you', I checked the DB and the myrecord is still 'hello'. Why? How to go around that? Do I have to encode the newline first?

How To Save People's Details Using MySQL?
Basically i want people to enter in there name and contact details and an answer to a simple question. I then want that information to be stored somewhere, so i can retrieve it once a month. Do i use Microsoft access?

Mysql Save To A Temp File
In the later part of June a new Linux Mysql server was installed.
While mysqld was still running,the data folder was moved to a different
volume and a soft link to the new location was put in it's place.I
know, bad idea,but everything seemed to work fine, so I didn't think
anything of it.Today, the server had to be rebooted for the first
time since, and now all data since the folder move is gone. It's as if
mysqld was just using ram to cache everything, and not writing out
changes to disk.Is this true, that all data was only written to
memory and not disk, or is it possible that the data was written out to
a temporary location somewhere that I might be able to recover some of
this data from?

Save HTML Page In MySQl
What is the best way to save a HTML page in MySQL? I just need the text not the images. I intend to save several 1,000 pages. Should I create a field or referance the pages which would be saved as html files to a directory. I'm not sure what the pros/cons of each method or if there are any other ways to do this.

MySQL Administrator -- Save Custom Graph
So im using the MySQL Administrator GUI (downloaded from mysql.com) and I LOVE IT!

But, there is a slight issue. I want to save the graphs I create so that when I restart the machine the same graphs can be accessble.

How can I save my graph formulas? If there something like .mysql-admin under the ~/ path or something like that?

What Format Should I Save My Date Info In MySQL
I have to 2 questions:

1) What format should I save my date info in mySQL?

2) Is mm/dd/YYYY  '10/31/2004' a good solution?

Users can do search and display data from certain date to certain date.

How do pros go about it? date >'10/31/2004' and date < '11/31/2004'?

Write/Move/Save Pdf To MySQL Table?
Is upload the only way to pass a file to a table?

I have a contract.pdf which is generated via php (FPDF) and saved in a temporary file. I need that file then moved /written to the appropriate customer table in our database (MySQL ) so that the temporary file may then be overwritten by the next Customer/Order.

While I am able to upload the file via <input type="file" name="uploadpdf> and related uploader.php, asking our web-users to “browse” for the file does not suit our needs, and of course adding a default value

<input type="file" name="uploadpdf" value="http://localhost/crm/modules/Orders/contract.pdf"> doesn’t work either.

As the file is always the same (modules/Orders/contract.pdf) how may I manage that move automatically, (say with a ‘Confirm Order’ button) to the database?

MySQL 4.1 &amp; JDBC 3 Cannot Save &amp; Read Asia (Big) Character
MySQL 4.1 can save & read character through JDBC 3.
Is any trick to save & read Asia (Big5) Chinese character ?

Chinese Chars OK
I have mysql 5 and php 5.1.2 with chinese chars in utf8 on mysql.
Browsing the tables in phpmyadmin shows correct chinese characters.
However, a custom php page to display them shows only ???

At the top of my php page I did include:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Chinese Characters
I use 'LOAD DATA INFILE'.
bUT can not load Chinese characters from a txt file to a table

Importing Chinese Characters
I've got a problem with importing chinese characters into a mysql-table
and have read several mailings but didn't find a solution.

i have a utf-8 text file that contains chinese characters. the table
where i want to import the data using "load data local infile" has
collation utf8_unicode_ci. but after the import is done, the chinese
characters are converted into so strange characters. to show the
chinese symbols in a php-script i use mb_convert_encoding() which shows
me the characters properly, but the problem is that i have to order by
the col that contains the chinese characters, so the chinese characters
mustn't be converted after importing. when i use the form in phpmyadmin
to add data it is possible to store the characters properly. is there a
way to achieve this by using load data local infile?

Can't Insert Chinese Characters
In my local machine, I am using:
ASP.NET 1.1
MySql 5.0
MySQL Connector Net 1.0.6

I can retrieve and update tables contain Chinese characters without problems.

But when I pushed everything into the hosting site, I can retrieve but can't insert or update Chinese characters. It will show "?" instead.

The hosting site is using MySQL 4.1.14.

Chinese Characters - UTF8
I am attempting to store Chinese text in a table with UTF-8 encoding and utf8_general_ci collation.  After being stored, they are retrieved and displayed on a web page.  On that page, which is properly set to use the UTF-8 character set, about 95% of the characters are correct, but a few are replaced with question marks and boxes. 

the fact that most are correct indicates to me that my settings are correct in all places, but perhaps the UTF-8 Character set is incomplete.

Characters that work fine (Hex):
? (C3A5CB86E280BA)
? (C3A9E282ACC2A0)
? (C3A7C5B8C2A5)
? (C3A7E280B0C592)

Characters that are not working (Hex):
? (C3A53F3F)
? (C3A5E2809C3F)
? (C3A6CB863F)

I am using ColdFusion MX 7 and the MySQL ODBC connector on a Windows machine. This is a shared hosting environment, so I may not be able to upgrade anything.

Displaying Chinese Characters
I install MySQL v4.1.14 in WindowXP as a service. I store all the data in the plain text file and load it into the database. All the data are stored in the database successfully but all the chinese characters become '????'

Every time I need to set the character set to big5 before I can see the chinese characters in the command line interface. How can I set the big5 as the default character set?

Although I can see most of the chinese characters after setting to big5, some of the characters are still in '????' Why this happens?

Thirdly, even if I can see the chinese characters in the command line interface, all the chinese characters change back to the '????' again when I use the web browser to see the data. How to fix up this problem?

Displaying Chinese Characters
I am designing a website that needs to be bilingal English/Chinese. I decided to create a MySQL table to hold page contents with a field called language with values en or cn.

I have two PHP pages, one queries on all records with en and has a character set "iso-8859-1" the other queries on all records with cn and has a character set "gb2312".

I have decided to enter the data using an Access database linked to the MySQL database using MyODBC. When I enter english characters all works fine. when I enter chinese charcters, they initially display fine on my PC as chinese characters, but once the record has been entered these are replaced with ?? symbols.

The question marks appear to originate from the MySQL database because they show up in the Access database, the online chinese page and using PHP MyAdmin.

Search Chinese Simplified
Hello, everyone. I would like to ask something about searching Chinese simplified characters from the database. Every time I searched, it won't display data,but if I searched without a condition it displayed all data including Chinese simplified characters.

Databasing Chinese Content
My company is looking into developing spanish and chinese versions of their website. Building a custom content management system seems to be the best route for this but I'm curious as to MySQL's ability to database chinese (and other non alphabetic languages like arabic and japanese) content.Has anyone dealt with this issue or have a recommendation on another database platform I could use that offers support for this requirement?

Can Not Load Chinese Characters
I use 'LOAD DATA INFILE' syntax to insert records into a table. The txt file contains Chinese characters.After executing the command,there was no error dsplayed,but the Chinese characters were not inserted into the table,instead there was blank when I typed 'select * from table'.

Can't Enter Chinese Characters
I have tried to follow instructions online as well as other threads in this forum, so far to no avail. I am using JSP, Java 1.4, MySQL 4.1 and Tomcat 5.5 on Windows XP.
1) I have set my JSPs to use UTF-8 wherever possible. I have a form where I can enter Chinese characters into a form, which hits a servlet, but text always arrives to the servlet garbled.
2) When I try to directly do an INSERT to a column and insert a chinese character, it comes up as ??? mySQL Query browser says "Data truncated to column 'translation' at row 1' ErrorNumber 1265.
3) I have made sure that each table's encoding is UTF-8.
Not sure what else to do. I can't find any easy instructions to do this. If you know of one,

Sorting Chinese, Japanese
I have been asked to look into support for sorting non-latin 'alphabets' such as Chinese and Japanese. I already know that MySQL supports UTF-8, though my interest is in finding out how well MySQL support sorting of entries for these writing systems and what supplementary configuration I may need to do.

How To Show Chinese Character Correctly?
i'm using Mysql5.0 now, it's char_set is latin_1 and my os is WinXP Chinese Edition. In my tables, chinese characters can be shown correctly from mysql command line, but chaos when i use mysql GUI tools and phpMyAdmin. what's wrong? what should i do ?

Store And Read Chinese Characters
I'm writing a vbscript application that reads UTF-8 XML containing Chinese
characters. Any suggestions how to store these characters in MySql 4.0.x ?

Do I need to set a special encoding such as Big5 on the database ?

Does MySql support storing UTF-8 ? If so what data types / encoding do I
need to use ?

Are there any special considerations for using MySql/ODBC and ADO to get and
put the data.

Save Changes
I'm working on a membership database (MySQL 4.1) with about 350 members. The client wants every change made to be recorded so that there is a record of what was changed. So they want what row was changed, what was changed within that row, when it was changed, and who made the changes. Is there a way to so this automatically in MySQL or do I need to set up a new table and alter all existing queries?

How To Save Commands?
I want to know how to save previous commands. I am using mysql 5.0 in a Windows operating system. i want to know is there a method of saving commands (statements) when I use the command prompt (shell) to execute command to mysql server.

Insert_id Save
The problem: I fill one table with something, then grab the insert_id from it.
Then i add that insert_id to another table to link the two together.
This is for making an account.
The problem: what if multiple users make an account at the same time and the queries get mixed up?

E.g. these are run before insert_id has a change to kick in
insert into table1 by user1
insert into table1 by user2
insert_id then gives me the insert_id from user2 while i was expecting the one from user1
Will this be a problem and if so how is it best solved?

Looking Up Duplicate Record Or Adding New Unique Record
CREATE TABLE tbllayer (
LayerID int(11) NOT NULL default '0',
LayerSize int(11) NOT NULL default '0',
IceTypeID int(11) NOT NULL default '0',
Fingerprint char(16) binary default NULL,
PRIMARY KEY (LayerID),
UNIQUE KEY Fingerprint (Fingerprint),
KEY IceTypeID (IceTypeID)
) TYPE=MyISAM;

We have an internet monitoring application which stores objects in the above
table, with the fingerprint an MD4 of the object. In general about 30% of
the time an object monitored is already in the table, in which case we don't
want to re-insert it, we just want to find out it's ID. The percentage may
vary between 10% and 50% though.

Currently we have a cache in our application which works like this:

- object is monitored and its fingerprint taken
- is the fingerprint in the cache? if so, take its ID from there
- if not, do a SELECT on the table - if a match is found add it to the cache
and use its ID
- if not, INSERT the record into the tablem use its ID and possibly add it
to the cache too

Ok. In general, is it better to:

- do a SELECT to see if the record exists and if not INSERT it
or
- do an INSERT, and if it fails then do a SELECT to locate the record

What about if the duplicate ratio is high or low?

Automatically Record Date Of Record Entry
I have my database table set up and I have an HTML form that is PHP driven that will add the information entered into the form into to my database table.

I have a local buy-sell-trade Website. The way it has worked is that people fill out a form and the results emailed to me. I then take the information and enter it into a Web page. I only want the ads to be displayed for 30 days. I keep the ad for a total of 6 weeks (displays for 30 days and sits in limbo for 2 weeks afterwords) and if not renewed within that 2 week limbo period - I delete it.

Entering all the ads and keeping up with the dates manually has become a burden. I've only recently began looking into databases. My hosting company provides me with phpmyadmin and mysql 5.0. I'm new to all of this but I have managed to set up a database table and a HTML form that is PHP driven that allows ads to be automatically added to the database table.

There is a lot I need to do to make this ideal, but one step at a time.

First, I need to know the date (March 02, 2006) the ad was created or added to the database table. I know that I need to add some piece of code to my php form to record this information, but what code and where do I put it? I know I will need to create an extra field in my database table to house the date - I can handle this.

I've read the date and time information here http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

but there's a lot there and I don't know which is right for my needs. Plus, it doesn't tell me how or where to insert it into my php form (or does it?).

Looking Up Duplicate Record Or Adding New Unique Record
CREATE TABLE tbllayer (
LayerID int(11) NOT NULL default '0',
LayerSize int(11) NOT NULL default '0',
IceTypeID int(11) NOT NULL default '0',
Fingerprint char(16) binary default NULL,
PRIMARY KEY (LayerID),
UNIQUE KEY Fingerprint (Fingerprint),
KEY IceTypeID (IceTypeID)
) TYPE=MyISAM;

We have an internet monitoring application which stores objects in the above
table, with the fingerprint an MD4 of the object. In general about 30% of
the time an object monitored is already in the table, in which case we don't
want to re-insert it, we just want to find out it's ID. The percentage may
vary between 10% and 50% though.

Currently we have a cache in our application which works like this:

- object is monitored and its fingerprint taken
- is the fingerprint in the cache? if so, take its ID from there
- if not, do a SELECT on the table - if a match is found add it to the cache
and use its ID
- if not, INSERT the record into the tablem use its ID and possibly add it
to the cache too

Ok. In general, is it better to:

- do a SELECT to see if the record exists and if not INSERT it
or
- do an INSERT, and if it fails then do a SELECT to locate the record

What about if the duplicate ratio is high or low?

Cannot Save Zero To BOOLEAN Field
A PHP script generates the following statement:

update cms_content set content_name = 'Blackmask', sub_cat_ID = 63, UDF1_1 = 'Blackmask', UDF1_2 = '', UDF1_3 = '', UDF1_4 = '', UDF1_5 = '', UDF2_1 = 'http://www.blackmask.com', UDF2_2 = '', UDF2_3 = '', UDF2_4 = '', UDF2_5 = '', Comment = ' ', Author = 'Phil White', Edit_date = '20080106', reject_reason = 5, reject_text = 'The content of your submission does not fit the category for which it was submitted.', Released = 0, Sticky = 0, rejected = 0, UDC1 ='Around 20,000 books for reading online.', UDC1_bitfield ='', UDC1_uid ='', UDC2 ='', UDC2_bitfield ='', UDC2_uid ='', UDC3 ='', UDC3_bitfield ='', UDC3_uid ='', UDC4 ='', UDC4_bitfield ='', UDC4_uid ='', UDC5 ='', UDC5_bitfield ='', UDC5_uid ='' where content_id = 2974

In the application, it is rejected with

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' reject_text = '', Released = 0, Sticky = 0, rejected = 0 , UDC1 ='Around 20,000' at line 1

The problem is with "rejected = 0". If I set "rejected = 1", the statement works fine.

The CREATE is
`rejected` tinyint(1) default NULL,

Now here is the strange part. Using the MySQL query browser, the statement is accepted without problems with a value of 0 or 1. (I copied it through the clipboard from an echo.)

The columns "Released" and "Sticky" were created in the same way and accept either value without problem. I am at my wits' end.

Save Query Results
In other words, how do I build a new table from the results of a query, so I can access pieces of this data later without performing the same query (a very heavy one) over and over again?

Save Outputs Into Tables
I want to save the output from "describe tablename;" into a table so that I can extract it later. How to do this?

Fail Save System Task
i have a task which can take up some amount of times,
which is upload a .csv file, and import those content into database.

I would like to know whether a fail save design can be perform there.

Requirement
1. the script will resume (or start all over again) no matter which service down(apache/mysql)
2. Script auto resume witout human interaction after server restart complete
3. Data record content (from .csv) inserted into those several table tally(using transaction)
4. Mail notification (i really have no idea if the mail server down too :( )

Can someone give me some idea how to come out this kinda things?

Insert From PHP Won't Save Strings With Spaces?
I have a form that sends/posts the collected entries to a processing form which performs some checks to see if data entry meets all requirements, and redisplays the data they entered by re-invoking the $fields.  The user can look it over to see if everything is correct before submitting the data to be inserted into the database.  Note:  When I echo back the results from the form, all fields are correct and are not cut off (explained below).

But the problem is, if the user enters in data like this:

PictName:  'endang seaturtle.jpg' (just a string, no images stored in DB)
Comments:  'Buoy is in for repairs'

The data that is saved in MySQL database for Location is just "endang" and for the Comments, "" (empty/blank).  Most of the fields are just one word length and insert perfectly fine.

Location VARCHAR(20) NULL DEFAULT NULL
Comments VARCHAR(200) NULL DEFAULT NULL

My Insert looks like this:

$query = "INSERT INTO tblNetDesc (SubSample, InitialDate, NetClassID, PictName, Comment) VALUES ('$subsample', '$the_date2', '$netclassid', '$picturename', '$comment')";
$result = mysql_query($query) or die ($query.mysql_error());

Also if it helps, PictName is an input field and Comment is a textarea field on the form.

How come it won't save the white space?  Why isn't the comment field saving?

Save Images On A Table Field
i am a foxpro user, and i have been using a general field on my tables to put pictures in it.

is their a similar type of field in mysql table?

Save A List Of Unknown Length
I'm trying to create a db that I can store recipes in.I would like to have a table for the recipes and a seperate table for the ingredients,but each recipe will have an unknown number of ingredients.i don't really want to create max-ingredients +1 fields and I would prefer not to save a string of PKs that i have to parse appart.This has got to be a common task, how is it done?

Save Both Japanese And English Characters
I will try to explain you what is my trouble:

I am not be able to write in my database using asian characters:
1) &#12513;&#12483;&#12475;&#12540;&#12472;
2) &#51228;&#50808;&#54616;&#44256;
3) &#1072;&#1085;&#1080;&#1090;&#1100; &#1087;&#1072;&#1088;&#1086;&#1083;&#1100;
4) etc.. .. ..

I have a trouble using in my database asian characters.


When I copy and past them on my forum, I see that:
1) 分対
2) Ÿã˜ã¾ã›
3) ‚¹ã«ãƒ•ォーãƒ


I think that I have to set up my mysql in a different way.

I would like to know that:

How I have to do for saving both european characters and asian characters?
What version of mysql I have to use?
What are the character_set and the collation that I have to use ?

Calling A Script Save In Emacs
I'm a Linux user and I written a script in Emacs Text Editor. I was wondering if there was a way that I can have MySql read my script by the file name instead of copying and pasting the script in Mysql.

Save Game Score History
I want to save game scores in my DB. I’ve learned that two tables is suitable for this. One that takes care of the parameters for the games it selves where each row I contains a game, and one for the game scores where each row contains a player and only the bests scores for each player are saved.
Now I want to save all the scores each players submits. How do I accomplish this?

Save Command Output In Text File
How can i save output of "Select" command to a text file on server ?

Example :

SELECT email
FROM `forums`
into outfile "/text.txt";

^^ This does not works and gives this error on mysql prompt :

ERROR 1045 (28000): Access denied for user 'database_data'@'localhost' (using password: YES)

But if i just run this command on mysql prompt : It works ...

SELECT email
FROM `forums`;

It runs fine and displays result on screen.

But i want to save the output of the command in a text file on the server... Kindly let me know, right syntax to achieve it.

How I Can Save Both Japanese And English Characters, In My Text Box?
I will try to explain you what is my trouble:

I am not be able to write in my database using asian characters:
1) &#12513;&#12483;&#12475;&#12540;&#12472;
2) &#51228;&#50808;&#54616;&#44256;
3) &#1072;&#1085;&#1080;&#1090;&#1100; &#1087;&#1072;&#1088;&#1086;&#1083;&#1100;
4) etc.. .. ..

I have a trouble using in my database asian characters.


When I copy and past them on my forum, I see that:
1) 分対
2) Ÿã˜ã¾ã›
3) ‚¹ã«ãƒ•ォーãƒ

I think that I have to set up my mysql in a different way. I would like to know that:

How I have to do for saving both european characters and asian characters? What version of mysql I have to use? What are the character_set and the collation that I have to use ?

Getting Record Before Or After The Record That Meets The Criteria
In a query I want to get all the results and then order those results by last name, but then I want to filter those results down to only the record that comes before or after the record that has 'empno' = '1259'.

I want to get all the results already ordered and then filter them down to one record either before or after (depending on what is needed) the record where 'empno' = '1259'.


Copyright © 2005-08 www.BigResource.com, All rights reserved