mysql_select_db(database_name[,link_identifier])

Description: Selects a MySQL database.

mysql_select_db() sets database_name as the current active database to associate with link_identifier. If link_identifier is not given, it assumes the last opened MySQL connection.

Returns TRUE on success, or FALSE otherwise.

Example:

if (mysql_select_db ("products_db")) {
    echo "Connected to products!<BR>\n";
}

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.