NathanRX7
1-4-02, 02:28 AM
I'm getting really frustrated and confused here. I have PHPMyAdmin running on my computer, and it connects to my PowWeb database just fine, but for some reason, I cannot get any of my personal PHP scripts to connect. I always get this error trying to access http://www.goldcoastinspections.com/admin/test.php:
Warning: MySQL Connection Failed: Can't connect to MySQL server on 'pluto.powweb.com' (60) in /www/g/goldcoastins/htdocs/admin/test.php on line 4
Could not connect
I'm trying to use my test.php at this point, which looks like this:
#!/usr/local/bin/php
<?php
// Connecting, selecting database
$link = mysql_connect("pluto.powweb.com", "gcpidbuser", "mypassword")
or die("Could not connect");
print "Connected successfully";
mysql_select_db("gcpi")
or die("Could not select database");
// Performing SQL query
$query = "SELECT * FROM DynamicContent";
$result = mysql_query($query)
or die("Query failed");
// Printing results in HTML
print "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t<tr>\n";
foreach ($line as $col_value) {
print "\t\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
// Closing connection
mysql_close($link);
?>
Warning: MySQL Connection Failed: Can't connect to MySQL server on 'pluto.powweb.com' (60) in /www/g/goldcoastins/htdocs/admin/test.php on line 4
Could not connect
I'm trying to use my test.php at this point, which looks like this:
#!/usr/local/bin/php
<?php
// Connecting, selecting database
$link = mysql_connect("pluto.powweb.com", "gcpidbuser", "mypassword")
or die("Could not connect");
print "Connected successfully";
mysql_select_db("gcpi")
or die("Could not select database");
// Performing SQL query
$query = "SELECT * FROM DynamicContent";
$result = mysql_query($query)
or die("Query failed");
// Printing results in HTML
print "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t<tr>\n";
foreach ($line as $col_value) {
print "\t\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
// Closing connection
mysql_close($link);
?>