CakeFest 2024: The Official CakePHP Conference

mysql_drop_db

(PHP 4, PHP 5)

mysql_drop_dbDrop (delete) a MySQL database

Uyarı

PHP 4.3.0 itibariyle bu işlevin kullanımı önerilmemekte olup bu işlev ve özgün MySQL eklentisinin tamamı PHP 7.0.0 itibariyle kaldırılmıştır. Yerine, etkin olarak geliştirilmekte olan MySQLi veya PDO_MySQL extensions kullanılabilir. Ek bilgi: MySQL: Bir API Seçimi Bu işlev yerine kullanılabilecekler:

  • Execute a DROP DATABASE query

Açıklama

mysql_drop_db(string $database_name, resource $link_identifier = NULL): bool

mysql_drop_db() attempts to drop (remove) an entire database from the server associated with the specified link identifier. This function is deprecated, it is preferable to use mysql_query() to issue an sql DROP DATABASE statement instead.

Bağımsız Değişkenler

database_name

The name of the database that will be deleted.

bağlantı_belirteci

MySQL bağlantısı. Eğer bağlantı belirteci belirtilmemişse mysql_connect() tarafından açılan son bağlantı kullanılmaya çalışılır. Eğer böyle bir bağlantı yoksa mysql_connect() bağımsız değişkensiz olarak çağrılmış gibi bir bağlantı oluşturmaya çalışır. Hiçbir bağlantı yoksa ve yenisi de kurulamazsa E_WARNING seviyesinde bir hata üretilir.

Dönen Değerler

Başarı durumunda true, başarısızlık durumunda false döner.

Örnekler

Örnek 1 mysql_drop_db() alternative example

<?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";
}
?>

Notlar

Uyarı

This function will not be available if the MySQL extension was built against a MySQL 4.x client library.

Bilginize:

Geriye uyumluluk adına, kullanımı önerilmese de şu takma ad kullanılabilir: mysql_dropdb()

Ayrıca Bakınız

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top