473,569 Members | 3,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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 1512
ak1dnar
1,584 Recognized Expert Top Contributor
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 Recognized Expert Top Contributor
Please read the POSTING GUIDELINES next time.
Welcome to TSDN.
May 23 '07 #3
pbmods
5,821 Recognized Expert Expert
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
478
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 VOTE NOW; you may be able to vote on a version of this proposal later. See the PROCEDURE section below if you need information about how the...
8
2671
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 CANNOT VOTE NOW; you may be able to vote on a version of this proposal later. See the PROCEDURE section below if you need information about how the...
2
5037
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, sometimes not. From mysql: mysql> show databases; +-----------+ | Database |
0
1851
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
3236
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? Thanks, Raffi
0
1502
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 File->Get External Data->Link Tables->Files of Type list does not include ODBC databases. Interesting, it *does* include a 'type' of 'Registry Error...
1
3323
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. ... www.soft30.com/download-1-11975.htm - 31k - Cached - Similar pages MDBSecure 1.0.8.0 - Soft30.com Utility which makes it easy to create secure MS Access Databases, ... MS...
9
5843
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 is, when connecting to MySQL (or sending a query), I only specify 1 database connection resource ID. How does that play out when connecting to 2...
3
4396
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 databases into one single, sorted list, to present to the user? I guess one way would be, to use PHP to copy all the results from each database,...
1
3849
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 these databases used to collect data have the same tables. There are other databases which are available to all the users which contain common...
0
7619
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.