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




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?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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.

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.

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,

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.

Only Displaying So Many Characters Of A Result
have qry and list - bring back the last 10 titles in a DB and display the within the list/while... I need to only show .. say .. 25 characters of the title tho.. Ive tried substr stuff but as its inside a while and also inside a list ive got nowhere. There any query shortcuts?

ASP Not Displaying Time Stored In Mysql Displaying Date Instead.
I seem to be having a problem displaying time stored in mysql. The
format stored in the database is 13:15:05. The database data type is
time. I'm using asp vbscript and sql to retrieve the time store in
the database.

However asp recognizes the data type as date and
displays the date instead of the time. If I change the data type in
mysql to varchar then asp will display the time correctly, but I
cannot do it this way. I want to be able to convert the data type in
asp to string from date.

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" />

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?

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.

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.

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 ?

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?

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

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 ?

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 ?

Omitting Characters Between Characters?
This is what I wrote:

select f.faqdesk_id
, c.categories_id
, f.faqdesk_question
, c.categories_name
, f.faqdesk_answer_short
from faqdesk_description as f
join faqdesk_to_categories as f2c
on f.faqdesk_id = f2c.faqdesk_id
join faqdesk_categories_description as c
on f2c.categories_id = c.categories_id

It works just fine, but the column: f.faqdesk_answer_short has characters I want to omit.
For example, the results have html formatting.

<H1>Hello World</H1><br><b>How is your day?</b>

I want to perform the search without viewing the html. Is there a way to omit the brackets & anything between them?

Displaying
I have a field value ClientNo. This will auto-increment every time a client added to the system. The auto-increment works fine. The problem that I have, is that instead of displaying the a ClientNo as 2, I would like it to display as 000002. With the extra zeros as padding. Is it possible to assign the zero value with all those added zeros from the beginning?

Displaying A Certain Value
say I have a table with two columns and the values:
4 3
7 2
12 4

how do I get the table to take max(col1-col2) and display it in every row.

as in:

4 3 8
7 2 8
12 4 8

Displaying My Query
I have a table that has data in it that people have submitted via a form. Now I want to review that same data in the form that it was originally completed in. Is it possible to display this data, in the format by using one of the columns as an identifier..

Basically, these are work orders and if I key in a work order #, I want the work order to come up in the form, where I can review it, and then update it, after i have added comments and a purchase order #.

Displaying Information
I have inserted all of my information into my data base. Now I want to print it onto my website. I know how to get it to print onto my website, but I don't know how to organize it. I want to print the information into an table, and I want the table rows to alternate colors. Also I want to adjust font, how would I do this?

Displaying Data
I have a database with about 20 names in it. I need to be able to create a php query that will show the data one at a time so the user will have to click a button to show the next record. Any ideas on how this is done?

Displaying Dates
I need to be able to perform 12 queries (one for each month) so that the first month it displays is the month that it is, ie. if i visit the site in June then June will be the first month displayed and May will be the last month.

I know that I can DATE_FORMAT NOW() and get the actual month right now, how do I get the other months using this kind of method?

Displaying N Images In A Row
I am getting problem in displaying images after fetching from the database. I want to display 4 images in one row .But i didnt know the idea.. Could anyone help me to display the N no of images in a row..

Displaying Queries..
Currently, I have a MYSQL database, and a table within it called "links". Now, this table has a unique ID for each tutorial I add, a link to the tutorial, and a 'type' ie a photoshop/php/html related tutorial.

I primarily used this database to a) count the rows and display "we have XX tutorials in our databse", and b) to have a random tutorial display.

This code works perfectly. Now my problem.

As the list of tuts grows, it will be hard to for the user to navigate all of the tuts to find one they want. So I want to at the top of my tutorial page, include several links:

Please select a catergory:

Photoshop | PHP | CSS etc

and when photoshop is clicked, it displays all of the tutorials that have a 'type' of photoshop. How do I accomplish this?

Problem Displaying ONLY
I am trying to display records from last one min onward using the following query:

CODEres = mysql_query('SELECT * FROM album where date > "$timeout"') or die('<error>'.mysql_error().'</error>');

Displaying Results By Day
How can I display results by highest count for each day? For instance, top ten searches by day sorted by count().

Here is the code I've come up with so far, it manages to understand the current date and display some of the searches for that day, yet, does not display from highest to lowest, though the count() output works just fine.

$sql = "SELECT keyword, count(keyword) AS keywordcount,curdate() as date FROM queries GROUP BY keyword ORDER BY date DESC LIMIT 0, 10";

Here is what the db table looks like
id (auto_increment)
ip
keyword
time (datetime)

I know you might suggest using DATE_FORMAT(time,%Y,%m,%d) but i just could not figure out how to get that work correctly, maybe a BETWEEN? I think maybe the datetime format is messing it up and I need to separate days and compare.

Displaying Text
What I have are articles written by our customers that I want to put into a database table and then display them with the original formatting intact. I am using phpMyAdmin to administer the db.

I have been reading here for a while tonight and it appears that the recommended method is to store the full text article in the db table and NOT as a text file with a link in the db (e.g. /article/article1.txt).

So far - so good. However, when I extract the information back out of the table, no formatting is maintained. All of the headings and paragraphs run together to become one large paragraph - which is not very fun to read.

Displaying Coupons
I am writing a coupons system that works on the same principle as a dynamic ad system.

My table has two DATETIME columns coupon_date_start, coupons_date_end

I want to display only the coupons where NOW() falls inbetween the coupon_start_date and the coupon_end_date.

Displaying Categories
I have one table which holds all categories and subcategories. Basically, there is a parent field - if the parent field is 0, then the category is a top level category, but if it is other than zero, then it is a child category to the category with the id that is in the parent field.Hopefully you get what I mean
Basically, I'm looking for a way to make a drop down box (using php), which displays a category, then has all subcategories listed directly below it, but tabbed out a bit. Like the list of forums on the search page.

Displaying Output
i'm displaying output from table using a perl script.
i have a problem displaying the output of my table cause the content of the fields are in russian language.
in the table itself, for the fields i'm using:
Collation:utf8_bin
Type: Varchar(22)
it works normal when i look at it using PHPmyAdmin.
when i run a perl script to display the table output i see ?instead of the russian characters..How do i display it?

Displaying Info
I'm working on my picture section, i was wondering if there is a way to order how things are layed out using mysql. I want something like this


PIC 1 PIC 2 PIC 3
PIC 4 PIC 5 PIC 6
Ect ect.

Is there a way to do this and what would it be called?

Displaying All Items When Order Has Not Been Placed.
I have this SQL (I'm using MySQL)

SELECT
tbl_cottages.id,
tbl_cottages.cottage_name,
tbl_calendar.calendar_date,
tbl_bookings.id as booking_id,
tbl_bookings.book_date,
tbl_bookings.book_cottage,
tbl_bookings.book_status

FROM tbl_cottages, tbl_calendar, tbl_bookings

WHERE
tbl_bookings.book_cottage = tbl_cottages.cottage_name(+)
AND tbl_bookings.book_date = '#URL.calendar_date#'
tbl_cottages - includes all Cottage Name
tbl_calendar - has dates
tbl_bookings - this table contains any books that have been placed. So if I book 'Rose Cottage' on 'January 1' it goes into this database.

What I am trying to do is, list all the cottages in tbl_cottages, but if an order has been placed and an entry has been entered into tbl_bookings for 'January 1' I would like to display the text in 'tbl_bookings.book_status' next to the cottage on the page.

Obviously if we move on to a different date for eg 'January 2' the 'tbl_bookings.book_status' would show nothing unless an order has been placed.




Displaying Certain Dates For Certain Pages?
I am wanting to display certain dates on certain pages. For example:
newsletters.php
January 2007
Monday 15th January 2007 // link to another page to display the newsletter
Tuesday 16th January 2007 // link to another page to display the newsletter

February 2007
Saturday 10th February 2007 // link to another page to display the newsletter
Sunday 11th February 2007 // link to another page to display the newsletter

Displaying Records In Single Row.
I've written the following sql,but it is displaying the results in multiple rows,Could any body advise me on how to display the returned records in only one row.....

Displaying Images From Database
I am in the process of redisgning my site with PHP MySql and Smarty and I am having trouble getting the images to display when called from the database.

echo "<img src="./pages/viewimage.php?file=7">";

This is the code for viewimage.php is

<?php
include 'config.inc.php';
include 'open_db.inc.php';

$file = clean($file, 4);

if (empty($file))
exit;

if (!($connection = @ mysql_pconnect($hostName,
$username,
$password,
$dbname)))
showerror();

if (!mysql_select_db("czone", $connection))
showerror();

$query = "SELECT mimeType, img_File FROM tbl_Images
WHERE id = $file";

if (!($result = @ mysql_query ($query,$connection)))
showerror();

$data = @ mysql_fetch_array($result);

if (!empty($data["img_File"]))
{
// Output the MIME header
header("Content-Type: {$data["mimeType"]}");
// Output the image
echo $data["img_File"];
}

include 'close.inc.php';
?>

Displaying MySQL Dates In PHP
I have several fields in my database that are of type 'date'. I want to display this in a browser, but the display seems to ignore the data in each field and uses the following dates only.

Jan 19 2038
jan 1 1970

I have been using PHP's date() function to display the data.

MYSQL Displaying Images
well at the moment i am making a site and what is happening is this there is a form that you fill out and submit to a database. Now with the form there is a thing to upload images, a headline form and a message form. The headline is first hten the image uploader then the message. This is the tricky part. Should i on the page with the form put an image uploader in the form page and make the image upload and reload the page with the img tags which submit to the database (Do Img tags allow you to show images in mysql?) Or does anyone know any better ways i can show the article with the image used. That way the image is still uploading to the server but the link of the image is stored in the database and can be pulled out in [img] tags (if they can be used)



Displaying Data From A Row With SELECT
When someone clicks on a thumbnail image in my gallery.php page it takes them to my view.php page which is where this code is. The large image displays properly and the "im_name" is printed in bold.

But from the database I have comments "im_comments" about this image that I would like to also to print and that part of the code is not working. Can someone see the mistake? Code:

Selecting And Displaying Specific Row
I wonder if there is a way to select a specific row in a table and than displaying that row. For example i would like to dispaly results starting from the second oldest entry in the table ... thus omiting the latest entry. Can anyone point me in the right direction?

Displaying Only Part Of A Field
I have a field in my table that contains an ip address and text. I would like to query that field and only display the ip address. Can anyone help me out?

MySQL_queries Not Displaying On Browser
I have a problem with a Fedora Core 3 server build running Apache 2.0.52-3, PHP 4.3.9-3, MySQL-server 3.23.58-13.  It also has the php-mysql-4.3.9-3 installed.

The problem - bringing up Mozilla browser on localhost (for testiing purposes) the index.php page displayes fine, except the mysql_query results do not show up.  Nothing within the PHP tags show up, not even errors.

I've substituted the phpinfo (); within the php tags and it displayed the php info page with no problems.  So, I can only think that it has to do with mysql or Mozilla. Code:

Displaying Table Constraints
Does anyone know the syntax used to display the constraints in a table?

I am using MySQL v.3.23.58

I've looked in several forums and the MySQL manual, but haven't been able to find out.

Displaying Multipal Records
I have a table in MYSQL

publications(ID, Year, Publicationtitle, Publication .... )

The tables called ID, the seconday key is Year,

I want to display all records with the year 7 8 9 10 11 12 and 13.

The usual code I think is

<?php echo("$row['year']")

But am not sure how to do this, any help would be good.

What would the SQL be, WHERE year=7 but would it be where year=7,8,9,10,11,12,13 ???? no??

ps. Is it possible to connect to another table as well. The page Im creating all the font size, face, background colour information is stored in another table. I could use a query but that would mean making foreign key in publications which would take up space.


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