PHP 4.0 Bug #8507: Can't connect to MySQL 3.22.32
| From: | info at widg dot com | Date: | Mon, 01 Jan 2001 03:24:38 +0000 |
| Subject: | PHP 4.0 Bug #8507: Can't connect to MySQL 3.22.32 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-42574@lists.php.net to get a copy of this message | ||
From: info@widg.com
Operating system: Linux adrian1.cobalt.com 2.2.14C11 #2
PHP version: 4.0.4
PHP Bug Type: MySQL related
Bug description: Can't connect to MySQL 3.22.32
I own a Cobalt Raq4 preinstalled with PHP Version 4.0.1pl2 and Chilisoft ASP. Chilisoft ASP will
only work with Mysql 3.22.32. I am unable to connect to my databases using PHP 4.0.1 in MySQL
3.22.32. phpinfo(); returns Mysql Client API version 3.23.10-alpha. The script I am using is as
follows
<?php
//connect
$connection = mysql_connect("localhost","user","password")
or die ("Couldn't connect to server.");
//select db
$db = mysql_select_db("database", $connection) or die("Couldn't select
database.");
//create sql statement
$sql = "SELECT * (tablename)";
//execute sql query and get results
$sql_result = mysql_query($sql) or die("Couldn't execute query.");
//results
//format results by row
while ($row = mysql_fetch_array($sql_result)) {
$id = $row["id"]; //for every field copy this line and make it for that row.
echo "the contents you want displayed";
echo "the contents you want displayed";
}
//close connection
mysql_free_result($sql_result);
mysql_close($connection);
?>
I have filled in all of the correct parameters and I got the following message. The script is cut
from the page and the error message line matches up with the actual page.
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (111) in /home/sites/site2/web/info.php on line 5
Couldn't connect to server.
Is this a bug or is there a way to make PHP 4.0.1pl2 connect to Mysql 3.22.32.
Any help would be greatly appreciated
--
Edit Bug report at: http://bugs.php.net/?id=8507&edit=1