rondog Posted February 13, 2009 Share Posted February 13, 2009 I have a members table. Each member has a project field. In that project field I want to store the table reference and title of each of their projects. Each project will be a dynamically created table so I was thinking: 'project + next increment number + _user id|My_Title' so in reality it would look like: projectXXX_387|My_Title projectXXX_387 would be the table name and My_Title is associated with that table. I need to store more than one project so I was thinking something like: project100_387|My_Title&project101_387|My_Title&project102_387|My_Title etc.... Is this a good route to take or no? How could I break up a string like that into an object array? Link to comment https://forums.phpfreaks.com/topic/145012-need-to-store-a-string-and-then-break-it-up/ Share on other sites More sharing options...
corbin Posted February 13, 2009 Share Posted February 13, 2009 Look into database normalization. First off, does each user really need his/her own table per project? Next, don't store the projects like that. Use a 1 to many relationship. For example, have a projects table: user_id, project_name, project_description, project_table (project_table would be for if each project really does need a separate table) Link to comment https://forums.phpfreaks.com/topic/145012-need-to-store-a-string-and-then-break-it-up/#findComment-760935 Share on other sites More sharing options...
rondog Posted February 13, 2009 Author Share Posted February 13, 2009 Ah ok I will do what you said above The reason each project needs its own table is because each project will need to generate an xml sheet that would be similar to this: <?xml version="1.0" encoding="utf-8"?> <sourcelist> <item type="Text" title="Pre-Incident Indicators Facilitation" /> <item type="Video" title="Introduction" tcIn="00:00:25.00" tcOut="00:00:49.00" /> <item type="Video" title="Learning Activity Instruction" tcIn="00:01:04.00" tcOut="00:01:36.00"/> <item type="Video" title="Scenario" tcIn="00:02:32.00" tcOut="00:06:43.00" /> <item type="Text" title="What were the Human Behavioral Indicators?" /> <item type="Video" title="Human Behavioral Indicators Interaction" tcIn="00:08:25.00" tcOut="00:13:51.00" /> <item type="Text" title="What were the Equipment Indicators?" /> <item type="Video" title="Equipment Indicators Interaction" tcIn="00:13:51.00" tcOut="00:17:20.00" /> <item type="Text" title="What were the Surveillance / Reconnaissance Indicators?" /> <item type="Video" title="Surveillance / Reconnaissance Indicators Interaction" tcIn="00:17:23.00" tcOut="00:21:36.00" /> <item type="Video" title="Learning Objective" tcIn="00:29:09.00" tcOut="00:29:56.00" /> <item type="Text" title="Discuss the value of identifying Pre-Incident Indicators" /> </sourcelist> Link to comment https://forums.phpfreaks.com/topic/145012-need-to-store-a-string-and-then-break-it-up/#findComment-760940 Share on other sites More sharing options...
corbin Posted February 13, 2009 Share Posted February 13, 2009 So why couldn't you just have: project_id, text, video ? Link to comment https://forums.phpfreaks.com/topic/145012-need-to-store-a-string-and-then-break-it-up/#findComment-760943 Share on other sites More sharing options...
rondog Posted February 13, 2009 Author Share Posted February 13, 2009 So you're saying make a new table called like projectData or something and do: project_id, type, title, tcIn, tcOut Then I would do SELECT * FROM projectData WHERE project_id = 'the id of the current project' I think that might work. Is that what you meant? I dont understand how project_id, text, video would work Link to comment https://forums.phpfreaks.com/topic/145012-need-to-store-a-string-and-then-break-it-up/#findComment-760948 Share on other sites More sharing options...
corbin Posted February 13, 2009 Share Posted February 13, 2009 Yes, that's pretty much what I meant. Will each project have the same type of data associated with it? What exactly is a 'project'? Link to comment https://forums.phpfreaks.com/topic/145012-need-to-store-a-string-and-then-break-it-up/#findComment-761049 Share on other sites More sharing options...
rondog Posted February 13, 2009 Author Share Posted February 13, 2009 Yes each project will have essentially the same data. I have 2 hour video segments and teachers have the ability to mark in/out points on this video player, add titles, reorder them and essentially build a playlist of a custom video. This is being made if the teacher wants to show bits and pieces of this video rather than watching the whole thing. The teacher will also be able to share their projects with other teachers to use. Link to comment https://forums.phpfreaks.com/topic/145012-need-to-store-a-string-and-then-break-it-up/#findComment-761388 Share on other sites More sharing options...
corbin Posted February 13, 2009 Share Posted February 13, 2009 Yeah, sounds like it would be easier to store projects as rows then. Link to comment https://forums.phpfreaks.com/topic/145012-need-to-store-a-string-and-then-break-it-up/#findComment-761415 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.