Reputation: 31
sir, i have uploaded my website to hosting and when i run it, eror, how can i fix this i try before without those code that show how many member,topic,and comment i have in database and it works, but when i put the code to show that, it bcome like access denied
<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>
this is my code, and the result is here http://uasforum22.zz.mu.zz.mu/
Upvotes: 0
Views: 61
Reputation: 356
The error suggests that the username and password you are using to connect to the mysql database is incorrect - "Access denied for user". You hosting provider in all probability must have provided a utility(cpanel) to create/delete user (and password). Please create a new user and assign a password to same and use this credential in your connection.php. Also remember to grant all priviledges to this user temporarily. Later on once you are done with testing the db connection issues you may want to reduce access priviledge.
Upvotes: 1