Call of an external database from an independent php file

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

Set default country for server settings/installation profile

Hi all, I'm creating an installation profile and want the installer to provide a default value for the country in Server Settings. The code is as following:

Illustrator Drupal Theme Tutorial

I'm creating my 1st drupal theme and I need some help with illustrator. I'm fairly new to illustrator but familiar with photoshop.

http://www.gomediazine.com/tutorials/create-a-killer-band-site-in-drupal...

I know this tutorial is outdated. But I plan to create the theme, convert it from D5 to D6, & then D7.

I'm at the heading

Designing the Primary Navigation Area

How to scrapped data from website and store it into drupal database.

Hi,

Is anyone suggest me a drupal 7 module to scrap the data from website and store it into drupal database.

thanks in adavance

Examples for Developers

I installed Drupal and am trying to review the Examples For Developers page located at http://drupal.org/project/examples

There are no instructions of any sort on the page. At the bottom of the page there is a Download box. I downloaded the Drupal 7 examples. Now what?

The README file offers no instructions, and neither does the web page I downloaded these files from. How do I see these examples?

How can i add a custom variable to html.tpl.php

I'm trying to add a custom variables to html.tpl.php and it doesn't seems to work.

I can add a custom variables to the page.tpl.php by using mytheme_preprocess_page, but it doesn't work for mytheme__preprocess_html.

If anyone could enlight me, thanks.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x