<font face="comic sans MS">
<img src="image/header.jpg" width="100%">
<table border="1" widht="100%" height="50" align="center" bgcolor="#FBFBEF">
<tr>
<td width="90%" align="left" valign="bottom" ><img src="image/start.gif" alt="icon" width="26" height="26"></td>
<th><b>Welcome, Guest,please <a href="login.php" style="text-decoration:none; color:green">Login</a>" or "<a href="register.php" style="text-decoration:none; color:red">Register</a></b></th>
</tr>
<tr>
<td width="50%" align="left" valign="bottom"><font size="5" id="welcome"><strong>Welcome To Squad 3.0 Ghz FORUM</strong></font> </td>
<td id=clock align="right" valign="center"><strong><iframe src="http://free.timeanddate.com/clock/i4eh41xm/n108/tlsg/fn7/fs12/tct/pct/ftb/tt0/tw1/tm1/th1" frameborder="0" width="182" height="20" allowTransparency="true"></iframe><strong></td>
</tr>
<table border="1" bgcolor="#FBFBEF" width="100%">
<tr>
<td align="left" width="70%"><b><a href="index.php" ><img src="image/homeicon.png" widht="20" height="20"></td>
<td align="right" width="7%">
<?php
include 'connection.php';
$query1="select count(email) as num_user from user_login";
$result1=mysql_query($query1);
$row1=mysql_fetch_array($result1);
echo '*'.$row1['num_user'].'* Member';
?>
</td>  <td align="right" width="5%">
<?php
include 'connection.php';
$query2="select count(topic_id) as num_topic from topic";
$result2=mysql_query($query2);
$row2=mysql_fetch_array($result2);
echo '*'.$row2['num_topic'].'* Topic';
?>
</td>  <td align="right" width="7%">
<?php
include 'connection.php';
$query3="select count(topic_id) as num_comment from comment";
$result3=mysql_query($query3);
$row3=mysql_fetch_array($result3);
echo '*'.$row3['num_comment'].'* Comment';
?>
</td>
</tr>
</table>
这是我的代码, 结果就在这里 http://uasforum22.zz.mu.zz.mu/
答案 0 :(得分:1)
该错误表明您用于连接到mysql数据库的用户名和密码不正确 - &#34;用户访问被拒绝&#34;。您托管服务提供商必须提供一个实用程序(cpanel)来创建/删除用户(和密码)。 请创建一个新用户并为其分配密码,并在connection.php中使用此凭据。还记得临时授予此用户所有权限。稍后,一旦完成测试数据库连接问题,您可能希望减少访问权限。