You can call the mysql_drop_db() function to drop a database named by the db argument.
Syntax
int
mysql_drop_db(MYSQL *mysql,
const char *db)
Return values
0 is returned for an execution success, and a non-zero value is returned if an error occurred.
Errors
CR_COMMANDS_OUT_OF_SYNC: Commands were executed in an improper order.CR_SERVER_GONE_ERROR: The connection to the OBServer was disconnected.CR_SERVER_LOST: The connection to the server was lost during the query.CR_UNKNOWN_ERROR: An unknown error occurred.
Notes
This function is deprecated. Use mysql_real_query() or mysql_query() to issue an SQL DROP DATABASE statement instead.