Click to See Complete Forum and Search --> : PHP/MySQL Create/Display databases


GUIR
03-15-2005, 12:50 PM
Hi! all

Can someone pls let me know the following.

Is it possible to create new databases in MySQL using PHP.

Is it possible to list all databases in MySQL using either PHP or SQL.

Thanks and BR.

AdamGundry
03-15-2005, 01:57 PM
Yes, you can use CREATE DATABASE (http://dev.mysql.com/doc/mysql/en/create-database.html) and SHOW DATABASES (http://dev.mysql.com/doc/mysql/en/show-databases.html) queries. However, you might be better off getting a MySQL administration tool such as phpMyAdmin (http://www.phpmyadmin.net/).

Adam

gebezis
03-15-2005, 02:11 PM
if you have the privileges to create the databases the followig should work:

$query = 'create database dbname';
mysql_query($query);

GUIR
03-15-2005, 08:32 PM
HI!

Thanks for your support....

Best Regards