Hi,
Using the event onMouseOver, I'd like to get informations about the different regions of a map.
These informations are stocked in an external database (not in Drupal).
Within the settings.php file, I wrote the following:
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'drupal2',
'username' => 'root',
'password' => 'MAY@M9z1rT',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
'extra' =>
array(
'default' =>
array(
'database' => 'extraf',
'username'=> 'username',
'password' => 'password',
'host' => 'xx.xx.xx.xx',
'driver' => 'mysql',
),
),
);
In my .tpl.php file, a javascript function contains the following code line:
$.get("<?php echo $base_path . path_to_theme() ?>/actions.php"...
The actions.php file stands at sites/all/themes/myTheme/actions.php and contains:
db_set_active('extra');
$sSQL = "SELECT myField FROM myTable";
$query = db_query($sSQL);
...
db_set_active('default');
But, when passing the mouse over the regions, I get the error:
Fatal error: Call to undefined function db_set_active() in \sites\all\themes\monTheme\actions.php on line 3