 |
เจอ error mysql_connect ครับ ลองตรวจสอบไฟล์ connect ดูแล้วก็ไม่เห็นผิดปกติครับ |
|
 |
|
|
 |
 |
|
เติม @ ไว้ข้างหน้าครับ ซ่อน error
|
 |
 |
 |
 |
Date :
2016-11-10 15:35:48 |
By :
Dragons_first |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าย้ายเครื่อง รหัสผ่านอะไรเปลี่ยนไปบ้างรึเปล่า?
ชื่อ host อะไรแบบนี้ ถ้าทำงานได้น่าจะไม่ขาวแบบนี้นะ
|
 |
 |
 |
 |
Date :
2016-11-10 15:44:04 |
By :
{Cyberman} |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Check the following:
Is MySQL running?
Is there any firewall that could be blocking your computer from accepting connections to MySQL on port 3306?
Is MySQL listening on port 3306, or did it get changed to something nonstandard?
An odd one, but try changing from localhost to 127.0.0.1
cr: http://stackoverflow.com/questions/2768916/trouble-connecting-to-mysql-db-php
|
 |
 |
 |
 |
Date :
2016-11-10 15:49:53 |
By :
apisitp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เหมือน mysql ยังไม่ทำงานเลย
|
 |
 |
 |
 |
Date :
2016-11-10 17:33:18 |
By :
limberger |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองปรับบรรทัดนี้ดู
Code (PHP)
$select_db = mysql_select_db("xxxx",$MyConnec);
|
 |
 |
 |
 |
Date :
2016-11-11 08:41:20 |
By :
thesin18598 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยังไม่ได้ครับ
|
 |
 |
 |
 |
Date :
2016-11-11 10:08:09 |
By :
bleachakira |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมลองลบแล้วลง appserv 2.5.10 ดู ปรากฏว่าใช้ได้ปกติครับ
ตอนแรกที่ขึ้น error เพราะใช้ appserv 2.6 ไม่รู้ว่ามันเพราะอะไร
|
 |
 |
 |
 |
Date :
2016-11-11 10:48:41 |
By :
bleachakira |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เพราะ PHP version หรือเปล่า??
AppServ v 2.6.0
Release Date : 2008-05-10
Packages :
Apache 2.2.8
PHP 6.0.0-dev
MySQL 6.0.4-alpha
phpMyAdmin 2.10.3
AppServ v 2.5.10
Release Date : 2008-05-10
Packages :
Apache 2.2.8
PHP 5.2.6
MySQL 5.0.51b
phpMyAdmin 2.10.3
|
 |
 |
 |
 |
Date :
2016-11-11 11:01:33 |
By :
apisitp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
XAMPP ช่วยได้ครับ
|
 |
 |
 |
 |
Date :
2016-11-11 13:45:36 |
By :
Pla2todkrob |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอใส่ไม่ผ่านตัวแปร ได้ไหมครับของผมเคยเป็นไม่รู้ว่าจะเป็นเหมือนกันหรือปล่าว (น่าจะเป็นที่ PHP เวอร์วันเด้วยหรือปล่าว)
Code (PHP)
$MyConnect = mysql_connect("localhost", "root", "xxxx") or trigger_error(mysql_error(),E_USER_ERROR);
$select_db = mysql_select_db("xxxx", $MyConnect );
mysql_query("Set Names UTF8");
|
 |
 |
 |
 |
Date :
2016-11-11 16:22:45 |
By :
banditt |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
@mysql_connect("localhost","root","xxxx");
mysql_select_db("xxxx");
mysql_query("SET NAMES UTF8");
ใส่ไปแบบนี้เฉยๆไม่ได้หรอครับ
password ถูกหรือเปล่า
datadase ถูกไหม
|
ประวัติการแก้ไข 2016-11-11 16:39:49
 |
 |
 |
 |
Date :
2016-11-11 16:38:29 |
By :
Pla2todkrob |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|