<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Zendcasts Forum / Survey database structure?]]></title>
		<link>http://www.zendcasts.com/forum/viewtopic.php?id=117</link>
		<description><![CDATA[The most recent posts in Survey database structure?.]]></description>
		<lastBuildDate>Tue, 15 Dec 2009 02:24:56 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Survey database structure?]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?pid=500#p500</link>
			<description><![CDATA[<p>I feel I have a clear picture of what the goal is, but this gave me something to think about, start with and try out. I&#039;ll let you know how it goes.<br />Thanks for the respons. <img src="http://www.zendcasts.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (harri)]]></author>
			<pubDate>Tue, 15 Dec 2009 02:24:56 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?pid=500#p500</guid>
		</item>
		<item>
			<title><![CDATA[Re: Survey database structure?]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?pid=498#p498</link>
			<description><![CDATA[<p>Hi Harri,</p><p>it sounds like you&#039;ve jumped the gun a bit here. I would start with either &quot;user stories&quot; or high-level use cases. Basically write out all the main ways that each use uses the system. This starts by figuring out the &quot;actors&quot; or &quot;roles&quot; in a system and what each actor will do with the system. Remember that you&#039;re doing something that&#039;s goal-oriented. Once you&#039;ve established what data needs to be entered and how and when, it will be a lot easier to assess which relationships need to be managed in the db.</p><p>Things like a lookup table for FieldTypes come to mind (and a fieldtype_id in Field). however I&#039;m assuming that you&#039;re answers will also be related to users somehow. You might want to create a Form table with a 1-many relationship to fields (and then define that relationship in a cross table (e.g. formId, fieldType, FieldId) and then have user answers be related to the form instead of each individual field.</p><p>these decisions will affect your object graphs in Doctrine too, e.g. $user-&gt;Answer-&gt;FormType-&gt;Form-&gt;Fields</p><p>or whatever.</p><p>Hope that helps.</p>]]></description>
			<author><![CDATA[dummy@example.com (Jon Lebensold)]]></author>
			<pubDate>Mon, 14 Dec 2009 18:36:40 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?pid=498#p498</guid>
		</item>
		<item>
			<title><![CDATA[Survey database structure?]]></title>
			<link>http://www.zendcasts.com/forum/viewtopic.php?pid=493#p493</link>
			<description><![CDATA[<p>Okay, here it goes. </p><p>I have created a very simple system for registration for events. It&#039;s so simple that the fields is hard coded in the database. This kinda worked fine when people were registration for a trip, as the fields required where the same. But as we found out that we could use it for other things, the hard coded fields were no longer enough. So now I am going to make a completely new system (with ZF of course, and doctrine) so that we can make whatever field we need for the registration. Make it completely dynamic, as it should be.</p><p>So that brings me to the problem at hand: I&#039;m not quite sure how the database structure should be. I have several drafts but always seem to get stuck so now I need some help. I assume the structure would be very similar to how a survey database would be structured. Actually, the system will work much as Forms in Google Docs, but with additional features and will probably be base for a bigger system, with survey as a part of it. If I ever get that far;)</p><p>So her comes what I have got so far:<br /></p><div class="codebox"><pre><code>EVENT
  eventID
  eventName
  startDate
  endDate
  description
  maxAtt
  createdBy

FIELD
  fieldID
  fieldName
  fieldvalue
  required
  parent_field

ANSWER
  answerID
  fieldID
  content (the answer)</code></pre></div><p>And then I have a USER entity but thats not a problem. The field and answer is the tricky part. The user here is administrativ users. Not registrants or people that answers the survey. We want it so that users don&#039;t need to registrate for be able to registrate for a event;)<br />If or when we see that we&#039;ll need that I will face that problem then.</p><p>I googled a bit before I posted here and found this one:<br /><a href="http://discuss.joelonsoftware.com/default.asp?joel.3.72177.9">http://discuss.joelonsoftware.com/defau … .3.72177.9</a><br />Maybe the answer is there already?</p><p>Would be great if anyone of you had some ideas on how this should be done. <img src="http://www.zendcasts.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (harri)]]></author>
			<pubDate>Mon, 14 Dec 2009 05:01:59 +0000</pubDate>
			<guid>http://www.zendcasts.com/forum/viewtopic.php?pid=493#p493</guid>
		</item>
	</channel>
</rss>

