Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: slightly OT - forms in database Date: Sun, 08 Feb 2015 11:17:44 +0100 Lines: 33 Message-ID: References: <7a98b02a-f124-4fda-ad08-76852a689af3@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net UHExwII4d0GQoa2wLlAWfg5tzFJ/9o4RtzIZ1NwMENkZjJxZFo Cancel-Lock: sha1:uQ0BJwdfNtPwxNdV3aDlJWJi2cc= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: <7a98b02a-f124-4fda-ad08-76852a689af3@googlegroups.com> Xref: csiph.com comp.lang.php:14906 On 08/02/15 10:47, tim@timothyarnold.co.uk wrote: > > Q1: is it OK to store this as json or seralize in a database field in a row? As we don't need to search and don't want to create many empty columns? Depends on the database IMHO, if you go for postgresql, then json would be an acceptable data type http://www.postgresql.org/docs/9.3/static/functions-json.html > As we don't need to search and don't want to create many empty columns? That's todays requirement, but that will most likely change one day and then you want to be able to search without having to do a lot of full text searching. > The other question is - do you manually build the form design in PHP or has anyone used a database driven form builder before? This depends much on how the form is used, if the form is more or less static, then it's easier just hard code it, if it change a lot then make it dynamic where you have ha blue print for each form. For your case I would go for something dynamic where you can easily create forms, have this easily administrated from a web interface that you won't have to spend time on making new forms, but some low paid intern can do those. -- //Aho