[問題] 新手發問...
對不起~我的問題可能很簡單...但是我弄了兩個小時還沒辦法...
就我只是要用PHP取出mysql一個資料表的內容
資料庫叫music
table叫show
以下是全部語法
<html>
<head>
<title>
Music
</title>
</head>
<body background=""><FONT color="Blue">
<center>
<h1>
Music
</h1>
<hr>
<?
$SQLAccessID = "root";
$SQLpwd = "*******";
$SQLHost = "localhost";
$MyDatabase = "music";
$MyTable = "show";
$MyStmt = "SELECT * FROM show";
$MyLink = mysql_pconnect($SQLHost, $SQLAccessID, $SQLpwd);
if(!mysql_select_db($MyDatabase, $MyLink))
{
echo "無法「選擇」資料庫";
exit();
}
if(!($MyRun=mysql_query(sprintf($MyStmt, $MyTable), $MyLink)))
{
echo "無法查詢";
exit();
}
while($MyRes=mysql_fetch_object($MyRun))
{
echo $MyRes->show."<br>";
}
mysql_free_result($MyRun);
?>
</center>
</body>
</html>
以上結果跑出來都是"無法查詢"
請問我到底是哪裡出錯?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 134.208.10.231
推
06/09 11:02, , 1F
06/09 11:02, 1F
→
06/09 11:03, , 2F
06/09 11:03, 2F
推
06/09 12:53, , 3F
06/09 12:53, 3F