mysql_select_db()
int mysql_select_db(MYSQL *mysql, const char *database)
Use this function to select a different database for the current connection. The name of the new database to use is given as the second argument of the function. It returns zero if successful, and a nonzero value if not. Here is an example:
... mysql = mysql_init(NULL); mysql_real_connect(mysql,"localhost","ricky","adams",NULL,NULL,NULL,0); mysql_select_db(mysql,"workrequests"); ...