Oracle 5.0 Reference Manual page 2275

Table of Contents

Advertisement

See Also
mysql_query
mysql_select_db
20.7.2.5.9.
mysql_drop_db
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysql_drop_db
Drop (delete) a MySQL database
Description
bool mysql_drop_db(
string database_name,
resource link_identifier
=
=NULL);
mysql_drop_db
specified link identifier. This function is deprecated, it is preferable to use
DROP DATABASE
Parameters
database_name
link_identifier
Return Values
Returns
TRUE
Examples
Example 20.34.
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
$sql = 'DROP DATABASE my_db';
if (mysql_query($sql, $link)) {
echo "Database my_db was successfully dropped\n";
} else {
echo 'Error dropping database: ' . mysql_error() . "\n";
}
?>
Original MySQL API (Mysql)
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the
future. Instead, the
also
MySQL: choosing an API
Alternatives to this function include:
Execute a
DROP DATABASE
attempts to drop (remove) an entire database from the server associated with the
statement instead.
The name of the database that will be deleted.
The MySQL connection. If the link identifier is not specified, the
last link opened by
is found, it will try to create one as if
with no arguments. If no connection is found or established, an
E_WARNING
on success or
on failure.
FALSE
alternative example
mysql_drop_db
MySQLi
or
PDO_MySQL
guide and
related FAQ
query
mysql_connect
level error is generated.
2255
extension should be used. See
for more information.
mysql_query
is assumed. If no such link
mysql_connect
to issue an sql
was called

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents