Accessing an external database from a joomla module
Posted: Fri Mar 21, 2008 2:38 am
On a joomla 1.14 site
the code is fairly straightforward,
It works but breaks all following connections with the jos_database (as far as I can tell) ie any modules after this one stop working.
Is it because I need to make the external call, some kind of instance?.
Any help would be appreciated, this is my first module.
the code is fairly straightforward,
Code: Select all
<?php
defined( '_VALID_MOS' ) or
die( 'Direct Access to this location is not allowed.' );
$conn = mysql_connect(localhost,JoeBlogs,secret) ;
mysql_select_db(external_database) ;
$result = mysql_query("SELECT artist, title from historylist ORDER BY historylist.date_played DESC");
list($title,$artist)= mysql_fetch_row($result);
echo $title ; echo "<br>" ;
echo $artist ; echo "<br>" ;
?>
Is it because I need to make the external call, some kind of instance?.
Any help would be appreciated, this is my first module.