|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-01-02 08:51 UTC] sniper@php.net
[2001-03-09 21:23 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 10:00:01 2025 UTC |
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