UT-8 encoding
Posted by: Thunder Crew
Date: March 15, 2005 03:10PM

Creating a database table called "nickname"
that will be called in a php page that will load thier nick name for chatrooms.

this is the coding that is being used.

FOR THE TABLE USERS IN THE DATABASE
THIS CREATE THIER USER NAME TO LOG IN
THIER NICKNAME FOR CHAT ETC

CREATE TABLE users (
id int(11) NOT NULL auto_increment,
username varchar(22) NOT NULL default '',
password varchar(32) NOT NULL default '',
email_address varchar(155) NOT NULL default '',
nickname varchar(255) NOT NULL default '',
user_level enum('0','1','2','3','4','5') NOT NULL default '0',
forum_posts int(11) NOT NULL default '0',
profile text NOT NULL,
siggy varchar(255) NOT NULL default '',
last_post varchar(155) NOT NULL default '0',
last_login varchar(12) NOT NULL default '0',
style varchar(55) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM CHARACTER SET utf8;


and this is the php that calls the users nickname name for entering chat

$sql = mysql_query("SELECT * FROM users WHERE username = '$_COOKIE[username]'");
$row = mysql_fetch_array($sql);


if (!$row['nickname'])


The problem is if they use utf-8 unicode charactes to make cool looking names
it says nickname not allowed and ejects them from the chat.
I know it is not the chat program itself because i can bring in my cool names
on mIRC because my chat admins are stored in a text file on the server
not in the database.

i basicaly need to know how i can make the databse row for nicknames
to allow coded ascii ,utf-8 etc unicodes. even using alt code comands do not work.

so im thinking either is there a way to code the databse to allow utf-8 or other characters.
or is there a way to CONVERT the coded text from the databse into the characters ????
thanx in advance please any tips would help.

Options: ReplyQuote


Subject
Views
Written By
Posted
UT-8 encoding
3501
March 15, 2005 03:10PM
2098
May 07, 2005 08:30AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.