note 59275 deleted from function.mysql-connect by nlopess

From: Date: Thu, 01 Dec 2005 13:59:27 +0000
Subject: note 59275 deleted from function.mysql-connect by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-99416@lists.php.net to get a copy of this message
Note Submitter: Franklin ---- Hello, I have a problem with the connection to my MySQL database server. I am using a Windows XP Workstation (SP2) with Apache 1.3.33, MySQL 4.1.15 and PHP 4.4.1. With "MySQL Administrator" it is no problem to connect to the MySQL server and to see the databases there. This shows me that the MySQL Server is running. But when I try to connect to the database with my PHP script it is not working. I have tried a lot of things in the meantime but without success. As far as I understand the support for MySQL is integrated in PHP 4.4.1 and therefor it is not necessary to include a extension for this in the PHP.INI file! My PHP script looks like this: // ========================================= $mysql_host = "localhost"; $mysql_username = "user"; $mysql_passwort = "password"; $mysql_db = "database"; $linkid = mysql_connect("$mysql_host","$mysql_username","$mysql_passwort") or die ("Error: Connect to the database not possible!"); mysql_select_db("$mysql_db") or die ("Error: Database could not be selected!"); //========================================== With this script I am not able to login to the database. When I use the same user in "MySQL Administrator" it is working! Does anybody has an idea what the problem could be? Many thanks in advance! Franklin

« previous php.notes (#99416) next »