mysql_drop_db()
int mysql_drop_db(MYSQL *mysql, const char *database)
This function may be used to delete the database named in the
second argument of the function from the MySQL server. It returns 0 if
successful and a nonzero value if not. However, this function has been
deprecated. Use mysql_query() or mysql_real_query() with a
DROP DATABASE statement instead.
Here is an example:
... mysql_real_connect(mysql,host,user,password,NULL,0,NULL,0); ... mysql_drop_db(mysql, "db5"); ...
This returns a nonzero value if it fails, so a program that uses it should include error checking for the function.