Web Design and Development Forums

How to automatically 'add column' to table?

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


Go Back   Webforumz.com > Databases > MySQL

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Jan 21st, 2008, 21:13   #1 (permalink)
Junior Member
 
Join Date: Jan 2008
Location: Reykjavik
Posts: 30
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.
skuliaxe is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 22nd, 2008, 10:40   #2 (permalink)
 
JustinStudios's Avatar
 
Join Date: Mar 2007
Location: USA
Posts: 457
Blog Entries: 3
Send a message via MSN to JustinStudios
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
__________________
My Website www.justudios.com is here!
Availability: YES | NO
ASP | PHP |Flash | Design | Contract Work
JustinStudios is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 MySQL 2 Feb 3rd, 2008 08:17
Sorting A Table By Column Header NewDesigner MySQL 4 Dec 8th, 2006 01:53
Automatically updating table gshaw MSSQL & Access 1 Jan 19th, 2006 13:21
..copy data from column A in Table A to column B in Table B? gecastill MSSQL & Access 10 Jun 23rd, 2005 18:27
Table Column Headings and Page Breaks Trebz CSS Forum 8 Jun 4th, 2004 12:55



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 05:42.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59