I been trying for last 4 weeks to link my joomla database (mysql) To lightirc flash irc chat, i know theres away but i cant seem to find it,

Solution: Replace session_start(); in your external script with

define( '_JEXEC', 1 );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/../..' ));
define( 'DS', DIRECTORY_SEPARATOR );

require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();

Be sure to change JPATH_BASE to suit your directory structure.

Replace the $_SESSION[ 'name' ] = "value"; in your external script with

$session =& JFactory::getSession();
$session->set('name', "value");

Now you can retrieve this session variable using:

$session =& JFactory::getSession();
echo $session->get('name');

I know is what i need to use but have been able to work it out????