 |
ยหAccess denied for user 'ODBC'@'localhost' (using password: NO) มารคืออะไรคะ งงมากๆ ถ้าจะแก้ต้องทำอย่างไงคะ และก็อันอื่นด้วยช่วยหน่อยคะ |
|
 |
|
|
 |
 |
|
โปรแกรมแรกนะคะ
ชื่อโปรแกรม mysql_connect()
<!DCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http:// www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title> mysql_connect</title>
<?
$host = "localhost";
$username = "root";
$password = "123";
@mysql_connect($host,$username,$password)
or die ("MySQL connect failed");
?>
</body>
</html>
[font=Verdana]ผลรัน [/font]
ว่างเปล่า ไม่แสดงอะไรคะ
....................................................................................................................................
อันที่2
<!DCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http:// www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title> mysql_select_db</title>
<?
$db = "php_e_commerce";
@mysql_select_db($db) or die("MySQL select database failed");
?>
</body>
</html>
[font=Verdana]ผลรัน [/font]
แสดงคำนี้คะ
MySQL select database failed
................................................................................................................................................
อันที่3
<!DCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http:// www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title> mysql_query</title>
<?
@mysql_query("SET NAME utf8")or die(mysql_error());
$sql = "SELECT * FROM guest ORDER BY 'date'DESC";
$result = mysql_query($sql) or die(mysql_error());
?>
</body>
</html>
[font=Verdana]ผลรัน [/font]
แสดงคำนี้คะ
Access denied for user 'ODBC'@'localhost' (using password: NO)
......................................................................................................................................................
อันที่ 4
<!DCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http:// www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>mysql_fetch_array</title>
<?
$row = mysql_fetch_array($result);
echo "$row[id],$row[text],$row[name],$row[date]";
?>
</body>
</html>
[font=Verdana]ผลรัน [/font]
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\mysql_fetch_array().php on line 10
,,,
Tag : PHP, MySQL, HTML
|
|
 |
 |
 |
 |
Date :
2017-09-06 23:21:42 |
By :
love_good2531 |
View :
1835 |
Reply :
5 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Access denied for user 'ODBC'@'localhost' (using password: NO) คือ localhost มันไม่มี password ครับ
แต่ราไปกำหนดให้ให้มี ในบรรทัดนี้
Code (PHP)
<?
$host = "localhost";
$username = "root";
$password = "123";
@mysql_connect($host,$username,$password)
or die ("MySQL connect failed");
?>
เลยฟ้องแบบนั้น
|
 |
 |
 |
 |
Date :
2017-09-07 09:14:47 |
By :
nutzaaclub |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เอาทูกฟลายมารวมกานเปนฟลายเดียวแล้วทามงานคร้าบ (55555)
คุณเล่นแยกไฟล์ อันแรกทำงานได้ ส่วนอันอื่นไม่ทำงานเพราะมันขาดส่วนสำคัญไป
|
 |
 |
 |
 |
Date :
2017-09-07 09:23:56 |
By :
Chaidhanan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เราจะบอกยังไงดี
วิธีการเขียน PHP ให้เปิดปิดแท็กให้ถูกต้องทุกครั้ง <?PHP //เปิดปิดแท็กให้ถูกต้อง;?>
เพราะตอนนี้มันปี 2017 แล้วนะ
เดี๋ยวพออัพขึ้นโฮส ก็จะมาตั้งกระทู้ถามอีกว่าทำไมไม่แสดง มีแต่หน้าขาวๆ
|
 |
 |
 |
 |
Date :
2017-09-08 10:02:13 |
By :
Pong Thep |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|