searls03 Posted April 21, 2011 Share Posted April 21, 2011 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? Quote Link to comment Share on other sites More sharing options...
Maq Posted April 21, 2011 Share Posted April 21, 2011 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. Quote Link to comment Share on other sites More sharing options...
searls03 Posted April 21, 2011 Author Share Posted April 21, 2011 well I have never made tables relationly, how would i do that? is there a way you can auto add a column? Quote Link to comment Share on other sites More sharing options...
Maq Posted April 21, 2011 Share Posted April 21, 2011 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. Quote Link to comment Share on other sites More sharing options...
searls03 Posted April 21, 2011 Author Share Posted April 21, 2011 I can't find the relation view button. v. 2.11.4. Quote Link to comment Share on other sites More sharing options...
Maq Posted April 21, 2011 Share Posted April 21, 2011 I can't find the relation view button. v. 2.11.4. For what? Quote Link to comment Share on other sites More sharing options...
searls03 Posted April 21, 2011 Author Share Posted April 21, 2011 well it said to click the relation view button in the tutorial thingy.........can't find it though......... Quote Link to comment Share on other sites More sharing options...
Maq Posted April 21, 2011 Share Posted April 21, 2011 well it said to click the relation view button in the tutorial thingy.........can't find it though......... Not sure, I don't use PHPMyAdmin. Quote Link to comment Share on other sites More sharing options...
searls03 Posted April 21, 2011 Author Share Posted April 21, 2011 do you have any more examples of relations? if not, could you tell me how I could do it so a new column adds please. Quote Link to comment Share on other sites More sharing options...
searls03 Posted April 21, 2011 Author Share Posted April 21, 2011 or tell me how exactly rows should be linked and how they should link to each other? Quote Link to comment Share on other sites More sharing options...
Maq Posted April 21, 2011 Share Posted April 21, 2011 thread ------------- name id replies ------------- text id t_id You would know that all replies with a specific t_id are linked to a specific thread. Quote Link to comment Share on other sites More sharing options...
searls03 Posted April 21, 2011 Author Share Posted April 21, 2011 how do I make it auto add columns, my hosting service does not support relations in it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.