View Single Post
Old 04-14-2008, 05:13 PM   #5 (permalink)
benton
The Contributor
 
Join Date: Apr 2008
Posts: 78
Thanks: 0
benton is on a distinguished road
Default

OK. I'll try to explain it better. The database table has, among other items, the following columns
HTML Code:
table stone {
group TEXT null,
text  TEXT null,
data  TEXT null
}
When filling in the information to be stored, there is an html table the user completes
HTML Code:
Group Text Data //title of table columns
G1    T1   D1   //user input
G2    T2   D3   //uer input
The user has to enter in all three or the data is not accepted. The data for each one is then imploded so that each field in the database is added as
HTML Code:
group = "g1","g2" 
text = "t1","t2" 
data = "d1","d2"
and so on. When the data is read back out of the database, all three entries are there and match to one another (group[0] = text[0] = data[0]). If I added a sort order column to the database for each row, that would probably solve the problem but it would add extra work for the user. I was hoping for a way around that. I'm stuck at how to read in the data and group it by the groups. So if the database contained data as
HTML Code:
table stone {
group "g1, g2, g4, g2, g1",
text  "t1, t2, t4, t5, t6",
data  "d1, d2, d4, d5, d6"
}
it would need to be displayed as
HTML Code:
g1
 t1 d1
 t6 d6
g2
 t2 d2
 t5 d5
g4
 t4 d4
benton is offline  
Reply With Quote