By: Michaelsen
Date: 2008-06-11
Time: 14:18
|
headergrp + block=option
Hello there,
The following should be easy, but I believe I'm missing the point completely.
I have the following two tables on my database:
fields
field_id
field_title
fields_values
row_id
field_id
field_name
The php+mysql side:
$tbsquery = "SELECT * FROM fields_values
JOIN fields ON fields.field_id = fields_values.field_id
ORDER BY fields.field_id ASC";
$TBS->MergeBlock('fieldsSel',$db,$tbsquery);
|
The tbs side:
<tr>
<td><!--[fieldsSel.field_title;block=tr;headergrp=field_id;comm] --></td>
<td><select name="select">
<option value="[fieldsSel.row_id;block=option]"> [fieldsSel.field_name]</option>
</select>
</td>
</tr>
|
The result is everything comes fine except only one value listed for the option tag for each headergrp, it is not looping and I'm not sure why.
I appreciate any help!
Regards,
- Michaelsen
|
By: Michaelsen
Date: 2008-06-11
Time: 16:31
|
Re: headergrp + block=option
I'm using TBS 2.05.3 for PHP4
|
By: Michaelsen
Date: 2008-06-11
Time: 16:54
|
Re: headergrp + block=option
Hello again,
I noticed I can achieve what I want with sub-blocks, but I thought with JOIN and headergrp would be more pratical.
cheers,
- Michaelsen
|
By: Skrol29
Date: 2008-06-13
Time: 00:15
|
Re: headergrp + block=option
Hi Michaelsen,
If you replace "headergrp" with "parentgrp" it should work better.
The point is that sections of the same block cannot be encapsulated. A "parentgrp" section is the exception.
|
By: Michaelsen
Date: 2008-06-13
Time: 17:08
|
Re: headergrp + block=option
Mr. Skrol29, thank you for the reply.
If I replace headergrp by parentgrp for some reason it will hang and break the 30s execution time for php.
If I replace the below code:
<td><!--[fieldsSel.field_title;block=tr;headergrp=field_id;comm] --></td>
|
With the following code:
<td><!--[fieldsSel;block=tr;parentgrp=field_id;comm] <!--[fieldsSel.field_title;comm]--></td>
|
Then it will work fine.
Please keep up the excellent work with TBS!
|
|
Posting in progress.
Please wait...
|