Skip to main content

Views3 Integration ( Add Db_prefix in settings.php for drupal 7 )


These instructions assume CiviCRM and Drupal are on separate databases located on the same physical host, and that the same database user has access to both the CiviCRM and Drupal databases.
  1. Before making any changes, it is strongly advised that you make backups of your mysql databases and settings.php file.
  2. Make sure you are logged into your Drupal site as the administrator.
  3. Visit http://yourdomain.com/civicrm/admin/setting/uf?reset=1 Replace with the domain of your Drupal site/installation.
  4. You should see a page with output that begins with: "$databases['default']['default']['prefix']= array("
  5. Copy everything inside this box, including the trailing ");"
  6. Open /sites/default/settings.php for editing from the root directory of the site, typically "public_html" on most servers. (NOTE: This assumes you have a single site installation. The location of the settings file might be different depending on whether or not you have multiple sites)
  7. Find the database connector array. This is where Drupal stores the information regarding the MySQL database and the necessary credentials to connect to it. The array beings with " $databases = array ( " then goes on to include the location and MySQL credentials, as well as additional options.
  8. Paste the output from step 3 here. Be sure to paste it AFTER the trailing ");"
  9. Save the file. You might want to clear your site cache at this point. 
  10. You should now be able to create views based on CiviCRM data.
If It is not possible to complete, Still gives error then Add one line to $db_prefix array :

 $databases['default']['default']['prefix'] = array(
'default'   => 'default_',

For More Information Click Here .

Above steps is working for Drupal 7.

To do db_prefix in Drupal 6 : No need to add extra line.

Add The code which on the link below:

Your Drupal Site base path /civicrm/admin/setting/uf?reset=1

Comments

Popular posts from this blog

Set Multisite in drupal

For Linux 9.10 Please Follow the steps : 1) Extract the drupal in public html folder or any other folder.(say exampleDrupal). 2) Add below lines to exampleDrupal/sites/sites.php     $sites['site1.test'] = 'site1.test';     $sites['site2.test'] = 'site2.test'; 3)  Create two folders in exampleDrupal/sites/ folder.       as site1.test & site2.test.      OR      Using terminal run following commands :      i)  cd example.com/sites      ii) mkdir site1.test/ site2.test/ 4) Copy the default.settings.php file from  exampleDrupal/sites/default to site1.test &  site2.test folder.     OR      Using terminal run following commands :       i) cp default/default.settings.php site1.test/settings.php       ii) cp default/default.settings.php si...

To get pager on page

Use of pager query :   Drupal 4.6 - 6 :  pager_query($query, $limit = 10, $element = 0, $count_query = NULL) Perform a paged database query. Use this function when doing select queries you wish to be able to page. The pager uses LIMIT-based queries to fetch only the records required to render a certain page. However, it has to learn the total number of records returned by the query to compute the number of pages (the number of records / records per page). This is done by inserting "COUNT(*)" in the original query. For example, the query "SELECT nid, type FROM node WHERE status = '1' ORDER BY sticky DESC, created DESC" would be rewritten to read "SELECT COUNT(*) FROM node WHERE status = '1' ORDER BY sticky DESC, created DESC". Rewriting the query is accomplished using a regular expression.  $output1 .= theme('pager',null, $count, 0); This is used to get the number. We can use this pager query in "Custom Search...