thorsten/phpMyFAQ — Issue #337: database table character set issue
Author: jiangzhanyong
Created: 2011-11-06 12:59:54+00:00
State: open

I was a user from China, and tested the phpmyFAQ recently. The system is great. I found an issue with database, and the issue is easy to be solved.

I use MySQL database to install phpmyFAQ. While I add Chinese character in the dashboard, the Chinese character display ?? instead of correct character.

I checked the create database file, mysql.sql.php, and change the code from:

$query[] = "CREATE TABLE ".$sqltblpre."faqadminlog (
id int(11) NOT NULL,
time int(11) NOT NULL,
usr int(11) NOT NULL,
text text NOT NULL,
ip text NOT NULL,
PRIMARY KEY (id))";

to

$charset_collate = 'DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci';

$query[] = "CREATE TABLE ".$sqltblpre."faqadminlog (
id int(11) NOT NULL,
time int(11) NOT NULL,
usr int(11) NOT NULL,
text text NOT NULL,
ip text NOT NULL,
PRIMARY KEY (id)) $charset_collate";

In this way, I force the database table to utf8 set.

I hope this maybe help to you.