Categories > TinyButStrong general >

Joomla+tbs

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: j joomla
Date: 2009-02-26
Time: 05:48

Joomla+tbs

How to connect to a database with another account and password ?
Using the external script, could you give an example of how to config the database.
By: Skrol29
Date: 2009-02-26
Time: 09:34

Re: Joomla+tbs

Hi,

Here is an example.

Joomla article:
{tbs}script=scriptname.php{/tbs}
<table>
  <tr> <td> [blk.name;block=tr] </td> <td> [blk.subname] </td> </tr>
</table>

scriptname.php:

$cid2 = mysql_connect('localhost', 'user', 'password');

$TBS->MergeBlock('blk', $cid2, 'SELECT name, subname FROM table1');

mysql_close(cid2);

By: j joomla
Date: 2009-03-06
Time: 04:14

Re: Joomla+tbs

Thanks a lot.
It worked perfectly.
By: j joomla
Date: 2009-03-26
Time: 05:33

Re: Joomla+tbs

Where to put the name of the database ?
By: j joomla
Date: 2009-03-26
Time: 05:37

Re: Joomla+tbs

Want to connect to a different database with another account and password.
By: Skrol29
Date: 2009-03-27
Time: 15:28

Re: Joomla+tbs

Hi,

For another connexion, you must use a PHP script to establish the new connection. Then you can use the same script to do the MergeBlock() ans specify the new connection id to MergeBlock().

You can do this using the "external script" or "internal script" method of the plug-in.

Examples here:
http://www.tinybutstrong.com/plugins/joomla/tinybutstrong_help.html