May 2005
Intermediate to advanced
352 pages
14h 39m
English
mysql_create_db( )
int mysql_create_db(MYSQL *mysql, const char *database)
Use this to
create a new database on the MySQL server. The new
database's name is given as the second argument.
This function has been deprecated. Instead, a CREATE
DATABASE statement should be given with
mysql_query( ) or mysql_real_query().
... mysql_real_connect(mysql,host,user,password,NULL,0,NULL,0); mysql_create_db(mysql, "new_database"); mysql_select_db(mysql, "new_database"); ...
This program excerpt creates a database
named new_database. The parameters for the
mysql_real_connect( ) function are variables
declared earlier in the program. Notice that the fifth argument (the
parameter for the initial database to use) is set to NULL.
Read now
Unlock full access