By: Allen Montz
Date: 2005-10-20
Time: 17:13
|
Option sub blocks
I am trying to post information about user's on a website. The main block gets all the basic user info (username, email, phone, etc...). User's also belong to 1 or more departments. So there is a subblock, to display all their departments within the same table row as their user info.
The problem is, after the sub block displays all its info (using a [...;option=tr], the main block skips to the next record, as opposed to displaying the remaining info of the current record. Then when the row is finished, it goes to the next record.
So basically, instead of alternating by table rows to display each record, it altnertes by td's after the sub block.
I think it is a problem with a main block and a sub block both containing an option, but this seems to be allowed according the tbs manual.
I have tried using both sql and arrays, and the problem occurs the same with either. Also, the data is all stored correctly on the php side.
I know this is confusing, but has anyone had similiar problems, or have any ideas on how to handled nested option blocks?
|
By: Allen Montz
Date: 2005-10-20
Time: 18:42
|
Re: Option sub blocks
nevermind, turns out it can be done in one neat sql query using:
GROUP_CONCAT([DISTINCT] expr [,expr ...]
[ORDER BY {unsigned_integer | col_name | expr}
[ASC | DESC] [,col_name ...]]
[SEPARATOR str_val])
So mine was:
GROUP_CONCAT(pp_dp_dept_name ORDER BY pp_dp_dept_name ASC SEPARATOR '<br>') AS dept_name
and a GROUP BY username at the the end of the full query.
|