Jump to content

use php to add mysql columns


Reaper0167

Recommended Posts

I'm stuck in a rut. I have a table in mySql. I'm looking to click on a button on my page, and have whatever name is on that page get added to a new column in mySql. I would like to have the columns named. Name1, Name2, Name3, and so on. Creating new columns in mySql with PHP is no problem when I put the column name in the sql statement. What is the trick to have PHP check to see what column names are already there(Name1, Name2), and then add then next one(Name3)? So the columns need to created in the script while adding the name that is displayed on the page. Any input would be appreciated. Thanks.

Link to comment
https://forums.phpfreaks.com/topic/162855-use-php-to-add-mysql-columns/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.