PHP 5.3, MySQL 5.1. Using the command line to do the excercises in chapter 5 of ‘Build Your Own Database Driven Web Site Using PHP & MySQL’.
When I type the following, and then query the table, the ‘name’ field cuts off the name after the initial ‘Z’, i.e., the name shows up as ‘John Q. Z’:
update author SET name = 'John Q. Zäppo' WHERE id = '3';
I’m on a windoze system, so i’m typing ALT+0228 at the command line to insert the ‘ä’. Should I be using escaped unicode instead? If so, how? This just inserts the string ‘Z"u00E4"ppo’:
update author SET name = 'John Q. Z"\\u00E4"ppo' WHERE id = '3';
and typing the HTML entity (‘ä’) produces similar results.
Thanks,
More info (I just got to chapter 7, wherein all of the updates & insertions are handled by PHP), and was able to add the umlauted ‘a’ thru the primitive content manager I’m building thru the exercises. However, the fact remains that I can’t insert any extended UTF8 characters in the windows command line; I just now tested it with a different character (ø) and the string gets cut off just before the odd character, both in the CLI output and in the html output.
CREATE TABLE author (
[INDENT]id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,[/INDENT]
[INDENT]name VARCHAR(255),[/INDENT]
[INDENT]email VARCHAR(255)[/INDENT]
) DEFAULT CHARACTER SET utf8;
CREATE TABLE author (
[INDENT]id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,[/INDENT]
[INDENT]name VARCHAR(255),[/INDENT]
[INDENT]email VARCHAR(255)[/INDENT]
) DEFAULT CHARACTER SET utf8;