Jump to content

Need to store a string and then break it up


rondog

Recommended Posts

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?

 

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)

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>

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.