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? Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/ 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. Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/#findComment-1204568 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? Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/#findComment-1204570 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. Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/#findComment-1204576 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. Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/#findComment-1204580 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? Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/#findComment-1204586 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......... Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/#findComment-1204588 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. Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/#findComment-1204591 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. Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/#findComment-1204592 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? Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/#findComment-1204593 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. Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/#findComment-1204595 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. Link to comment https://forums.phpfreaks.com/topic/234374-auto-add-a-column-to-mysql/#findComment-1204634 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.