Thanks for your help.
I am currently on an XP box with the following software specs:
Apache/2.2.9 (Win32) PHP/5.2.6 and mySQL 5.0.51a/phpMyAdmin 126.96.36.199
I've uninstalled Apache/PHP/mySQL/phpmyadmi
and reinstalled it... No good.
I've SCRUBBED Google and this forum and other forums and none of the
The mySQL Command Line Client works GREAT!
So, mySQL is UP and RUNNING...
Attached is the code that is generating the following error:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in C:\Program Files\Apache Software Foundation\Apache2.2\htdoc
st1.php on line 9
Can't connect to MySQL server on 'localhost' (10061)
Yes, I've attempted to change hosts and usernames that are in the
user table with all permissions...
I've attempted to use 127.0.0.1 (and similar as mentioned on different EE Articles
for this issue.)
No Firewalls enabled (that I know of...)
Have disabled any type of security setting that I can think of that might block
any connections to the database, as well...
I've created a table called 'test' using the MySQL Command Line Client.
Inside, there is a user - John (as found in a bicubica apache-php-mysql install website.)
It SHOULD be displayed by the script attached to this Q.
I can access the info using the MySQL Command Line Client.
I've attempted to use both (and either of the two) for the php.ini file:
... and have stopped and restarted Apache during EVERY Change.
Thank you in advance for helping in resolving this issue.
# Define MySQL Settings
$conn = mysql_connect("".MYSQL_HOST."", "".MYSQL_USER."", "".MYSQL_PASS."") or die(mysql_error());
mysql_select_db("".MYSQL_DB."",$conn) or die(mysql_error());
$sql = "SELECT * FROM test";
$res = mysql_query($sql);
while ($field = mysql_fetch_array($res))
$id = $field['id'];
$name = $field['name'];
echo 'ID: ' . $field['id'] . '<br />';
echo 'Name: ' . $field['name'] . '<br /><br />';