473,385 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How do I get the list of databases in PHP/MySQL?

Hey in one of my allplication i want to retrieve all databases(using mysql presents in wamp) name in my combo box which is used in one of my form .
So pls help as soon as possible. I am using PHP and html only. I just want to retrieve names of databases present in wamp(phpmyadmin) to combobox.
If u find the solution pls contact me on ([removed --pbmods])
May 23 '07 #1
3 1506
ak1dnar
1,584 Expert 1GB
Hey in one of my allplication i want to retrieve all databases(using mysql presents in wamp) name in my combo box which is used in one of my form .
So pls help as soon as possible. I am using PHP and html only. I just want to retrieve names of databases present in wamp(phpmyadmin) to combobox.
If u find the solution pls contact me on ( vpchetan@gmail.com)
[PHP]<?php
$con = mysql_connect('localhost', 'root', 'dba');
$db_list = mysql_list_dbs($con);

$i = 0;
$counter = mysql_num_rows($db_list);
echo '<select name="dblist">';
while ($i < $counter)
{
$NAME = mysql_db_name($db_list, $i);
echo '<option value="'.$NAME.'">'.$NAME.'</option>';
$i++;

}
echo '</select>';
?> [/PHP]
May 23 '07 #2
ak1dnar
1,584 Expert 1GB
Please read the POSTING GUIDELINES next time.
Welcome to TSDN.
May 23 '07 #3
pbmods
5,821 Expert 4TB
Changed thread title to better match contents.
May 23 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Gary L. Burnore | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU CANNOT...
8
by: William Drew | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU...
2
by: Tim Williams | last post by:
I'm trying to write a simple python program to access a MySQL database. I'm having a problem with using MySQLdb to get the results of a SQL command in a cursor. Sometimes the cursor.execute works,...
0
by: Jay Blanchard | last post by:
-----Original Message----- From: Moritz Steiner =20 Sent: Wednesday, July 16, 2003 10:46 AM To: Jay Blanchard Subject: AW: monitoring I want to see: Number of queries =20
2
by: Raffi | last post by:
I use the --all-databases switch to backup my entire database. Sometimes there's a need to restore individual databases or tables form the backup file. What command should I use for this? ...
0
by: Iain Hosking | last post by:
I'm running Access 2002 (on W2K) and need to access a MySQL database. I've installed and configured the latest MySQL ODBC driver, and it works perfectly from Excel, but in Access 2002 the ...
1
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ......
9
by: noor.rahman | last post by:
I was wondering how it may be possible to query 2 MySQL databases using one query statement from PHP. For instance: SELECT database1.tableA.field1 UNION database2.tableB.field2. My concern...
3
by: Vik Rubenfeld | last post by:
I have to search 2 mySQL tables, and show the user a single sorted list that contains all the results from both mySQL queries. My question is, how do you get all the resulting items from both...
1
by: judy | last post by:
I have several databases that are used to collect data for different client-projects. My intention was to collect the data, and administer mySQL so each client could see only their data. Each of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.