Name

msqlSelectDB

Synopsis

int msqlSelectDB ( int sock , char *dbName ) 

Chooses a database for the specified connection. A database must be chosen before any queries are sent to the database server. In the case of an error, -1 is returned.

Example

/* Select the "mydatabase" database */
result = msqlSelectDB( dbh, "mydatabase" );
if (result == -1) { 
   print "Error selecting database!\n"; 
   exit(1); 
}

Get MySQL and mSQL 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.