note 49292 added to function.mysql-connect

From: Date: Sun, 23 Jan 2005 09:57:10 +0000
Subject: note 49292 added to function.mysql-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-83804@lists.php.net to get a copy of this message
I am using php-5.0.3, mysql 4.1.9 and Apache 2.0, I am trying to connect to mysql database using both mysqli_connect($db_server, $db_user,$db_pass, $db_name) and mysql_connect($db_server, $db_user,$db_pass,$db_name) I failed, I have set password for the database, so in my case, $db_server will be "localhost", $db_user will be "root",$db_pass will be "mypassword", $db_name will be "dbname" I wrote the following code to test the connection: $link = mysqli_connect("localhost", "root", "passwd", "dbname"); /* check connection */ if (!$link) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf("Host information: %s\n", mysqli_get_host_info($link)); /* close connection */ mysqli_close($link); Surprisingly, no error is shown. Can any expert tell me what is going wrong? you are welcome to send your comments to my email box at wang_di79@hotmail.com Billions of thanks ---- Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49292 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49292&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49292&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49292&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49292&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49292&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49292&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#83804) next »