Categories > TinyButStrong general >

tbssql V 2.5

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: TomH
Date: 2009-09-21
Time: 17:57

tbssql V 2.5

Thanks for the new version!

Just help me with the new $Db->TbsKey & make sure I understand the practical need for it...

it seems to me that only would need $Db->SetSqlKey() to be set if the application needs to be using multiple DB connections

so I would make the conn id for the second DB conn and that is the val used, as in...
$key = mysql_connect(..other DB..);
$Db->SetSqlKey($key);

Thanks,
TomH
By: Skrol29
Date: 2009-09-21
Time: 18:14

Re: tbssql V 2.5

Hi Tom,

No, it is not working like that. Your remark makes me understand that the doc is not clear. I will change it.

$Db->TbsKey must be a string value only.
By default it is 'tbssql' for the first TbsqSQL instance, and it is 'tbsqsql2' for the next instance, and 'tbssql3' for the next one, and so one...

The deferent values help to manage several database connections in a PHP script. For this, you just have to use $Db->TbsKey instead of the keyword 'tbssql' when using MergeBlock().
Thus, TBS will always use to correct TbsSQL connection.
For a good practice, let'ss say that you should always use $Db->TbsKey instead of 'tbssql' since version 2.5. And you don"t really matter what the value is.

The methods $Db->SetTbsKey() should be rarely used. It is only if you don't want to use the default values 'tbssql' , 'tbssql2', 'tbssql3'...
By: TomH
Date: 2009-09-21
Time: 19:13

Re: tbssql V 2.5


Well, that was very clear indeed ;) thanks a lot.

And thanks for TBS every day,
TomH