Puja
Puja

Reputation: 461

create database from web application in mysql database using admin panel in php

Here, Is my requirement :

My requirement is I have to creating table not using mysql database but using own custom UI

All the thing I have to do with admin panel.

Please can you give me some idea.How can I do that,

Thanks for your support.

Upvotes: 0

Views: 161

Answers (1)

user8608587
user8608587

Reputation:

You can have your custom UI to read all the information you need from the user. Then use the MySQL statement DDL to apply these information and create them into the database. You have all what you need, as following:

Create database from web application in database

You can use the CREATE DATABASE command to create the database in the mysql connection that you have.

After creating database can create number of tables with fields.

Then the user selects the predefined databases, then after the user inputs the table name, columns' names and data types. You can use the CREATE TABLE command to create the table with the information you get from the user.

Listing of created database and it's tables.

Use SHOW Databases to list the created databases. Also SHOW TABLES to list the tables.

To get the list of tables under a specific database, you can use

infomration_schema like this:

SELECT TABLE_NAME
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'database name';

Can modify the fields with type and size.

You can use ALTER TABLE to modify the types and sizes.

Upvotes: 2

Related Questions