<?php
$link = mysql_connect("localhost", "PUT_USERNAME_HERE", "PUT_PASSWORD_HERE")
or die ("Could not connect");
print ("Connected successfully");
mysql_select_db ("PUT-DB-NAME-HERE")
or die ("Could not select database");
$query = "SELECT * FROM PUT-TABLE-NAME-HERE";
//make sure you've got this area correct
// and if you're not sure check the snazzy phpmyadmin cheat sheat
// on creating queries!
$result = mysql_query ($query)
or die ("Query failed");
// printing HTML result
print "<table>\n";
while ($line = mysql_fetch_array($result)) {
print "\t<tr>\n";
while(list($col_name, $col_value) = each($line)) {
print "\t\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
mysql_close($link);
?>
Let the troubleshooting begin!
error 1
Warning: Access denied for user: 'denny@localhost' (Using password: YES) in /var/www/html/mysqlconnect.php on line 2 Warning: MySQL Connection Failed: Access denied for user: 'denny@localhost' (Using password: YES) in /var/www/html/mysqlconnect.php on line 2 Could not connect
Three Variables on line 2
-
"localhost"
-
"PUT_USERNAME_HERE"
-
"PUT_PASSWORD_HERE"
Access denied for user: 'denny@localhost'
I've checked the MySql table user running on localhost and 'everything' appears in order.
Now to figure out what variables need to be tweaked.
Ok, after a bit of tweaking on the original installation of MySQL (phpmyadmin apparently doesn't get to the 'root' of mysql) I've got a connection : Connected successfullyQuery failed
after looking at the code a little more closely (important that!) I found that my select query was missing the FROM statement! so MySQL is running/ phpmyadmin is running after playing with the all important config.php.inc! now on to edventure!
but edventure.php is still not working
I'm thinking it has something to do with the root privileges of mysql only because of the associated problems with this test script. Sadly, in configuring root of mysql phpmyadmin is no longer functioning. I'll have to revisit that issue soon.
