downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

mysql_list_fields> <mysql_insert_id
[edit] Last updated: Fri, 17 May 2013

view this page in

mysql_list_dbs

(PHP 4, PHP 5)

mysql_list_dbsBir MySQL sunucusundaki kullanılabilir veritabanlarını listeler

Açıklama

resource mysql_list_dbs ([ resource $bağlantı_belirteci ] )

MySQL sunucusundaki kullanılabilir veritabanlarını içeren bir sonuç göstericisi döndürür.

Değiştirgeler

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() değiştirgesiz 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 resource türünde bir sonuç göstericisi, hata durumunda FALSE döndürür. Bu sonuç göstericisinin veya mysql_fetch_array() gibi sonuç tabloları üreten bir işlevden elde edilen işlevselliğin tersini elde etmek için mysql_tablename() işlevini kullanın.

Örnekler

Örnek 1 - mysql_list_dbs() örneği

<?php
$link 
mysql_connect('localhost''mysql_user''mysql_parolası');
$db_list mysql_list_dbs($link);

while (
$row mysql_fetch_object($db_list)) {
     echo 
$row->Database "\n";
}
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

database1
database2
database3

Notlar

Bilginize:

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

Ayrıca Bakınız



add a note add a note User Contributed Notes mysql_list_dbs - [2 notes]
up
1
theriault
10 months ago
Another alternative to this function is:

SQL Query: SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA
up
0
matjung at hotmail dot com
3 years ago
The result pointer contains only the databases for which the mysql_user has the select priviledge granted.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites