diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-09-02 12:50:55 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-09-02 12:50:55 +0000 |
commit | 2d1476a0e7281a5884c873e1c8a748d512f31785 (patch) | |
tree | 209721efa97e20b549a42b74111f4b922be7ac4a /includes/install.mysqli.inc | |
parent | 1e04b134f4df85756e509b671ee14e901b65178c (diff) | |
download | brdo-2d1476a0e7281a5884c873e1c8a748d512f31785.tar.gz brdo-2d1476a0e7281a5884c873e1c8a748d512f31785.tar.bz2 |
#172433 by chx: use the proper mysqli error function if there is no connection
Diffstat (limited to 'includes/install.mysqli.inc')
-rw-r--r-- | includes/install.mysqli.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/install.mysqli.inc b/includes/install.mysqli.inc index a8a2ad1de..111a4a936 100644 --- a/includes/install.mysqli.inc +++ b/includes/install.mysqli.inc @@ -36,13 +36,13 @@ function drupal_test_mysqli($url, &$success) { $connection = mysqli_init(); @mysqli_real_connect($connection, $url['host'], $url['user'], $url['pass'], substr($url['path'], 1), $url['port'], NULL, MYSQLI_CLIENT_FOUND_ROWS); if (mysqli_connect_errno() >= 2000 || mysqli_connect_errno() == 1045) { - drupal_set_message(st('Failure to connect to your MySQL database server. MySQL reports the following message: %error.<ul><li>Are you sure you have the correct username and password?</li><li>Are you sure that you have typed the correct database hostname?</li><li>Are you sure that the database server is running?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => mysqli_error($connection))), 'error'); + drupal_set_message(st('Failure to connect to your MySQL database server. MySQL reports the following message: %error.<ul><li>Are you sure you have the correct username and password?</li><li>Are you sure that you have typed the correct database hostname?</li><li>Are you sure that the database server is running?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => mysqli_connect_error())), 'error'); return FALSE; } // Test selecting the database. if (mysqli_connect_errno() > 0) { - drupal_set_message(st('We were able to connect to the MySQL database server (which means your username and password are valid) but not able to select your database. MySQL reports the following message: %error.<ul><li>Are you sure you have the correct database name?</li><li>Are you sure the database exists?</li><li>Are you sure the username has permission to access the database?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => mysqli_error($connection))), 'error'); + drupal_set_message(st('We were able to connect to the MySQL database server (which means your username and password are valid) but not able to select your database. MySQL reports the following message: %error.<ul><li>Are you sure you have the correct database name?</li><li>Are you sure the database exists?</li><li>Are you sure the username has permission to access the database?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => mysqli_connect_error())), 'error'); return FALSE; } |