How to automatically 'add column' to table?

This is a discussion on "How to automatically 'add column' to table?" within the Databases section. This forum, and the thread "How to automatically 'add column' to table? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 21st, 2008, 21:13
Junior Member
Join Date: Jan 2008
Location: Reykjavik
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
How to automatically 'add column' to table?

Hi, I'm working on a web page where users fill in a form (about species).
The form has some basic input fields, radio buttons and an file upload option. But I would also like to give the user an option on adding a NEW text-area him/herself with a subject heading. I´m currently asking for help regarding that option over here.

If or when I manage to do that:
How will I be able to add those new text areas to the database?
Seeing as that I don´t have X number of table column for that information.

Would there be a counter for each new text area, and an WHILE function in the PHP code? (While new textarea = add column X to table)

I´m terrible at this stuff and seem to have dug my own grave with this project that I have to do. Any help would be great.
Thanks

Last edited by skuliaxe; Jan 22nd, 2008 at 00:59.
Reply With Quote

  #2 (permalink)  
Old Jan 22nd, 2008, 10:40
JustinStudios's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: USA
Posts: 404
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: How to automatically 'add column' to table?

The thing about it is you would be giving your user too much control of the database, this is very bad. Can this be done? Yep, quite easily actually, should it be done? No way. What you could do is have them add up to 4 new fields, and have these fields as blank options in your current table. This way they aren't adding to your database, but filling in some optional room you made for them. Also, make sure you have headings for these stored somewhere as well, which you can make an additional field for that.

Hope that helps
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a column to a table Jack Franklin Databases 2 Feb 3rd, 2008 08:17
Sorting A Table By Column Header NewDesigner Databases 4 Dec 8th, 2006 01:53
Automatically updating table gshaw Databases 1 Jan 19th, 2006 13:21
..copy data from column A in Table A to column B in Table B? gecastill Databases 10 Jun 23rd, 2005 18:27
Table Column Headings and Page Breaks Trebz Web Page Design 8 Jun 4th, 2004 12:55


All times are GMT. The time now is 00:07.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43