Hello everyone,

PHP just stopped being able to connect to mysql.  mysqld-nt is running, and
is running alright becuase I can connect, select databases, and execute sql
queries through the mysql client.  However, when I try to establish a
connection through PHP, the connection never gets made.  This just started
happening 2 days ago.  This also happens on one of my machines at school.

Here's the code I'm using to test (which has worked fine before):
<?
if ($connection = mysql_connect("localhost","root","F0AA2pa8")) {
        if ($db = mysql_select_db("sweetleaf", $connection)) {
                if ($sql = mysql_query("SELECT * FROM users ORDER BY id ASC")) {
                        $num = mysql_num_rows($sql);
                        if ($num < "1") {
                                print "<font face=Arial size=2>No data could be 
retrieved.<br></font>";
                        }
                        else {
                                while ($row = mysql_fetch_array($sql)) {
                                        $id = $row["id"];
                                        print "<font face=Arial size=2>$id</font><br>";
                                }
                        }
                }
                else {
                        print ("<font face=Arial size=2>SQL <b>NOT</b> 
executed.<Br>Error No.:" .
mysql_errno() . "<br>Error: " . mysql_error() . "</font><Br>");
                }
        }
        else {
                print ("<font face=Arial size=2>Database <b>NOT</b> selected.<Br>Error
No.:" . mysql_errno() . "<br>Error: " . mysql_error() . "</font><Br>");
        }
}
else {
        print ("<font face=Arial size=2>Connection <b>NOT</b> established.<Br>Error
No.:" . mysql_errno() . "<br>Error: " . mysql_error() . "</font><Br>");
}
?>

Has anybody else experienced any problems like this?  I think this started
happening after I accidentally wrote some bad code that killed inetinfo.exe
(IIS).  PHP hasn't been able to connect to MySQL since then.

Thanks everyone,
Tyler


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to