Is it possible to obtain the NAME of each column you create

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PHPHelpNeeded
Forum Commoner
Posts: 83
Joined: Mon Nov 17, 2014 8:03 pm

Is it possible to obtain the NAME of each column you create

Post by PHPHelpNeeded »

Hi,

I know query is good to retrieve, update, insert, and remove things from the table.

(For instance I found a like with the MySQL command list but I didn't find the following functions in my questions).

Question#1: but is it possible with a MySQL query to retrieve the names of the columns you created for a table?

for instance, I want to build a driver program that will test the integrity of table I create in the database.

Question#2: once you create a table, and it has values in it, can you add more columns to it, to expand the table?

My server program will need to update tables in that manner, wondering if it is possible.

Thanks.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Is it possible to obtain the NAME of each column you cre

Post by Celauran »

PHPHelpNeeded wrote:Question#1: but is it possible with a MySQL query to retrieve the names of the columns you created for a table?
SHOW COLUMNS
PHPHelpNeeded wrote:Question#2: once you create a table, and it has values in it, can you add more columns to it, to expand the table?
ALTER TABLE
Post Reply