Greetings All,
I have been for the longest while testing my .php website files by uploading them to my server first and going to the URL. However, this is the biggest waste of time ever.
I finally decided to setup Apache2 Server and php 5 on my system. I also setup a mysql database. However, when i try to connect to an external database located on my server to test my application, I get no connection. I tested my connection with a script like this:
[code=php]
<?php
$username = “pee_wee”;
$password = “let_me_in”;
$hostname = “mysql.mywebsite.com”;
$dbh = mysql_connect($hostname, $username, $password)
or die(“Unable to connect to MySQL”);
print “Connected to MySQL<br>”;
// you’re going to do lots more here soon
mysql_close($dbh);
?>
Of course I enter the right connection info. I then take this same test connection file, upload it to my server and I get the echo ‘Connected to MySQL’. When i test it on my local machine, I don’t get any errors, or outputs. Does anyone know why this may be happening? I am not behind any firewalls, or anything of that nature. I think its a problem with how I setup apache2 or php or something. Does anyone know how I can get a mysql database working on my local system prefferably with phpmyadmin?