title: Database design for custom form builder (and storage of results)
body: <p>I'm trying to implement a custom form builder, similar to those provided by <a href="http://wufoo.com/" rel="noreferrer">Wufoo</a> and <a href="http://docs.google.com/" rel="noreferrer">Google</a>.</p>
  
  <p>While I've created a simple UI to create these custom forms with, my issues lie in the database design. Upon creating the form, a JSON implementation is saved in the database (would like to improve this) and referenced to build the form that a user would see.</p>
  
  <p>Upon submission, I'd like to store all of the fields of the form in a database. Following the JSON structure used for designing the database, this is easy enough. However <strong>I'd like each individual field to be searchable</strong>.</p>
  
  <h2>The questions:</h2>
  
  <ol>
  <li>Is there a better way to store the form design?</li>
  <li>What data structures/models would fit storage of the form's results? <em>I've seen that EAV could be a possiblity, but due to the different input types involved (drop-down, checkbox, text, textarea) this may become tedious.</em></li>
  <li>Which structure would allow easiest searching and permit the use of WHERE clauses? <em>The JSON example given, doesn't allow me to do this quite as nicely</em> </li>
  </ol>