|
|
|
ดึงข้อมูลจาก Database มาแสดงแล้วเป็นภาษาต่างด้าว ??????? |
|
|
|
|
|
|
|
เพิ่มเติม อันนี้หน้า mysql_connect.php ค่ะ
Code (PHP)
<?php
define (DB_USER, "root");
define (DB_PASSWORD, "aftersale1234");
define (DB_DATABASE, "aftersale");
define (DB_HOST, "localhost");
$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
$host = "localhost";
$user = "root";
$password = "aftersale1234";
$database = "aftersale";
$connect = mysql_connect($host,$user,$password) or die ("could connect database !");
$select = mysql_select_db($database,$connect) or die ("could connect dataase !");
mysql_query("SET character_set_results=utf8");
mysql_query("SET character_set_client='utf8'");
mysql_query("SET character_set_connection='utf8'");
mysql_query("collation_connection = utf8_unicode_ci");
mysql_query("collation_database = utf8_unicode_ci");
mysql_query("collation_server = utf8_unicode_ci");
date_default_timezone_set("Asia/Bangkok");
?>
|
|
|
|
|
Date :
2018-12-25 14:24:27 |
By :
gullanun_s |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mysqli
mysqli_connect
mysqli_select_db
mysqli_query
ของผมเขียนประมาณนี้ครับ
Code (PHP)
$serverName = "localhsot";
$userName = "username";
$userPassword = "password";
$dbName = "db_name";
$con = mysqli_connect("$serverName","$userName","$userPassword","$dbName");
$con->set_charset("utf8");
ลองดูครับ
|
ประวัติการแก้ไข 2018-12-25 15:21:48
|
|
|
|
Date :
2018-12-25 15:17:15 |
By :
nobetaking |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
โค๊ดเก่า mysql 12-24 ถ้าไม่ใช้ก็เอาออก ซะ เปลือง connection
mark ไว้ก่อน ก็ได้
|
|
|
|
|
Date :
2018-12-25 16:14:51 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2018-12-25 16:42:28 |
By :
2015381758558256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|