Categories > TinyButStrong general >

Problens with sub block and mysql

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Eliseu
Date: 2005-08-30
Time: 02:37

Problens with sub block and mysql

Hi there..

I have a problem on my sub-block :
------------------------------------------------------------------------------
>>>>html

[blk_fotos; block=begin] [blk_fotos_sub; block=begin; p1=blk_fotos.id]]

<img src="../images/[blk_fotos.diretorio]/[blk_fotos_sub.thumb]" width="119" height="88" align="left">

            [blk_fotos.nome; max=20]<br>
            [blk_fotos.local]<br>
            [blk_fotos.data]<br>

[blk_fotos_sub; block=end] [blk_fotos; block=end]

------------------------------------------------------------------------------
>>>>>php

$TBS->MergeBlock("blk_fotos",$conn,"select id,nome,data,local,diretorio from danferrana_fotos_grupos
                                            order by id desc");
$TBS->MergeBlock("blk_fotos_sub",$conn,"select id,thumb from danferrana_fotos
                                            where grupo = '%p1%'");
------------------------------------------------------------------------------

It works OK. But I only get 1 result! Not all that is in my mysql db.
What´s wrong with this?

Tnx...
By: Skrol29
Date: 2005-08-30
Time: 11:19

Re: Problens with sub block and mysql

Hi Eliseu,

I cannot see why it doesn't work as expected.
Maybe the parameter "p1=blk_fotos.id]" wich should be "p1=[blk_fotos.id]"  but I think you coded it correctly.

Double check your "block" parameters, because TBS displays only one record when parameter block is not found.
By: Eliseu
Date: 2005-08-30
Time: 15:56

Re: Problens with sub block and mysql

Thanks Skrol.

But the problem still exists. Only show 1 result. Probalbly i should try to avoid using [blk=begin] and [blk=end]. I thinks its simple, but maybe my problem would be solved.

See ya..
By: Skrol29
Date: 2005-08-30
Time: 16:13

Re: Problens with sub block and mysql

> Probalbly i should try to avoid using [blk=begin]

I think this has nothing to do, because the MergeBlock process is the same for any block syntax (if the syntaxe is correct).

I've tried your snippet but array data instead of a MySql connection, and it works ok for me, using exactly the same Html source.

Is the main block "blk_fotos" merged with only one record too ?
If it is the case, then the problem may not be because of the sub-block.
By: Eliseu
Date: 2005-08-30
Time: 17:10

Re: Problens with sub block and mysql

Sorry to bother you. My mistake!!!!! Jesus.. how dumb!!!!!!!!!

That´s why i love TBS, the support is GREAT. Congratulations Skrol.

Tnx..
By: Skrol29
Date: 2005-08-30
Time: 17:16

Re: Problens with sub block and mysql

:)