Jump to content

auto add a column to mysql


searls03

Recommended Posts

Is there a way to use php to make an automatic column addition to a table?  like if I had a comment form and want to save the replys in a database, I would want a column for each reply, is there a way to make a new column each time someone submits the form?

Link to comment
Share on other sites

Is there a way to use php to make an automatic column addition to a table?  like if I had a comment form and want to save the replys in a database, I would want a column for each reply, is there a way to make a new column each time someone submits the form?

Let's back up.  I don't think you want to create a new column every time someone makes a reply.  Your tables should be relational, meaning, you can relate each table in such a way to extract the specific information needed.

Link to comment
Share on other sites

well I have never made tables relationly, how would i do that?

Google and read some articles:

http://www.mikebernat.com/blog/Setting-Up_a_Relational_Database_in_MySQL

http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html

 

is there a way you can auto add a column?

Yes, but I already told you, I don't think you want to do that.

 

Have a table with replies that links each reply to each article/form/blog w/e it is.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.