Jump to content

SQL problems with UNICODE

- - - - -

  • Please log in to reply
No replies to this topic

#1
VakhoQ

VakhoQ

    Programmer

  • Members
  • PipPipPipPip
  • 127 posts
1) if i dont wont to have a problems with Unicode (when i conntect information from database in PHP) Where should I write "CHARACTER SET utf8 COLLATE utf8_general_ci?".

whre should i Write this code when I Creat DATABASE OR TABLE?

2) should i write down this 2 code In php file?
mysql_query("SET CHARACTER SET utf8");

mysql_query ("SET NAMES 'utf8'") ;

3) what is diference between this codes? which is good and bed and why?

For example My SQL code is like this:
is my code Correct?

CREATE DATABASE `VakhoQ` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;


CREATE TABLE `VakhoQ`.`C_lessons` (


`id` INT( 5 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,


`title` VARCHAR( 225 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,


`description` VARCHAR( 225 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,


`text` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL 


) ENGINE = MYISAM 




////////////////////////////





I have Creted Database named "vakhoQ"

then I make table c_lessons with "id", "title", "Description", and "text"




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users