ការកំណត់ដាតាបេស (databsae) ឲ្យមានដំណើរការជាមួយអក្សរខ្មែរ insert an Unicode character in databsae

http://jumnuoy.blogspot.com/2012/12/databsae-insert-unicode-character-in.html
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpwd = '';
$dbname = 'test';

$dbConn = mysql_connect ($dbhost, $dbuser, $dbpwd) or die ('MySQL connect failed. ' . mysql_error());

mysql_select_db($dbname) or die('Cannot select database. ' . mysql_error());
mysql_query("SET NAMES utf8");
function dbQuery($sql)

mysql_query("SET NAMES utf8"); //the main trick
and set proper charset in the HTML Head section
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpwd = '';
$dbname = 'test';

$dbConn = mysql_connect ($dbhost, $dbuser, $dbpwd) or die ('MySQL connect failed. ' . mysql_error());

mysql_select_db($dbname) or die('Cannot select database. ' . mysql_error());
mysql_query("SET NAMES utf8");
function dbQuery($sql)

mysql_query("SET NAMES utf8"); //the main trick
and set proper charset in the HTML Head section
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

0 comments:

Post a Comment

Followers

រឿង ដែលខានមើលមិនបាន

Contact us

Name

Email *

Message *

Your Language

Online

Copyright 2009 Simplex Celebs All rights reserved Designed by www.sruol9.com