Michael Collins wrote:
> I understand that any ASCII character can be stored within any of the
> non-numeric type fields. Does this mean just characters 1-255?
No, MySQL supports also multibyte character sets used in Asian countries. This means
much wider range than 256.
> What happens if I try to import a non-ASCII character, let say, into a
> VARCHAR field? Is it discarded or will I simply not be able to get into
> a MySQL field in the first place?
Nothing bad happens. Just MySQL will decide later how to use it in ORDER BY clauses by
character set stuff. Byte is byte.
> In addition, do all of the following need to be escaped before being
> insert into a database?
>
> \0 An ASCII 0 (NUL) character
> \n A newline character
> \t A tab character
You should use mysql_real_escape_string() C API function. This will escape now and in
future all needed stuff. If you still need explanation about escaping, read the manual
on http://www.mysql.com. There is surely section describing what should be escaped.
> In other words, am I correct that none of these characters can be stored
> in a MySQL string field (such as CHAR, VARCHAR, or TEXT)?
Yes. Problems appear when you sort those strings and they appear in
wrong order. Take the manual and read about character sets and languages
support. This surely helps you to avoid problems.
--
--
For technical support contracts, goto https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Tonu Samuel <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Security Administrator
/_/ /_/\_, /___/\___\_\___/ Hong Kong, China
<___/ www.mysql.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php