Hi, what would be the better approach to make custom fields like that it can be created from admin so later on table shouldnt be altered Like if customer has already table but we need to include more fields so we make one custome field table where one field will be label and other column name but in that case both table has to be altered every time One way is to already make max fields which is not a scenario in our problem. Any one having some idea would be great help Thanks
As I understood, adding a column is the problem? This is simply done with a SQL query. ALTER TABLE `table_name` ADD `column_name` TEXT; PHP:
yes we dont want to alter table every time...but i think you havent understood the main problem What would be the structure to add custom fields which is best way? Like user can add them by ownself without changing the code and without altering the table every time.
OH, in that way. That's a little bit harder, but create one column for the extra field and save the information like you want. For example: Myfield=Thevalue;Secondfield=Secondvalue;