• Suppose we have a Drupal site and an external application, and we want to use the same login for both. For example, we have an application which does something, but we have our users handled by Drupal, and we need to pass over to the application the information about the current user.

    Basically we need to tap into our Drupal's user database table. We also need to use Drupal's $_SESSION, but Drupal stores its sessions in the database by default, and the $_SESSION superglobal...

    Tags:
    Drupal, PHP
  •     First remember on which operating system(ubuntu,centos) you are going to install drupal. Here I tested with ubuntu and cent OS.

     Add these lines to example.com/sites/sites.php
        $sites['dev.site1.com'] = 'site1.com';
        $sites['dev.site2.com'] = 'site2.com';

    In Terminal:
         cd example.com/sites
        mkdir site1.com/ site2.com/
        cp default/default.settings.php site1.com/settings.php...

    Tags:
    Drupal, Linux
  • 1. For select Query.
          $result = db_select('node', 'n')
                  ->fields('n')
                  ->condition('nid', $node->nid,'=')
                  ->condition('status', 0,'>')
                  ->condition('uid', array(1,5,7),'IN')
                  ->execute()
                 ->fetchAssoc();

     Above Example is Equivalent to the Following in D6
    $result = db_query("select * from node where nid)=$node->...

    Tags:
    Drupal

Pages

X