The sql_selectdb() function is used to select a connection to a database server that offers a database for use. The function returns true of the operation is successful, otherwise it returns false.

The sql_selectdb() function has 3 parameters:

  1. $nom being the name of the database to use,
  2. $serveur,
  3. $option.

This function is used by SPIP during the installation routine to try to pre-select the name of the database to be used, by means of attempting to select a database with the same name as the login.

$test_base = $login_db;
$ok = sql_selectdb($test_base, $server_db);

Author Mark Baber Published : Updated : 12/03/23

Translations : English, français