2

I would like to create a view in Drupal to list civicrm contact details.
We need to copy code from Administer->system settings->CMS database Integration paste it in sites/default/settings.php.. I did so the way it was suggested. I am getting the following error.

SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'drupaluser'@'localhost' for table 'civicrm_contact'
dimzak
  • 2,511
  • 8
  • 38
  • 51

1 Answers1

4

I can't tell for sure without seeing your settings.php, but it sounds like the user for the Drupal database "drupaluser@localhost" doesn't have permissions over your CiviCRM database. Grant that permission in MySQL, and you ought to be set.

Andie Hunt
  • 705
  • 3
  • 8
  • Thanks @user3427722--to help other users finding this, could you mark this as the accepted answer? – Andie Hunt Mar 27 '14 at 13:07
  • .I have one more doubt.I am designing a matrimonial website.In civicrm->contacts->individual i have created matrimony subtype and it has some custom fields.I have linked these fields to drupal webform i.e data entered in form is stored in civicrm db.Now I'm displaying data in views.I want the user to filter the profiles based on height,salary location etc.In views I have exposed filters."I want the height and salary filter to be in range like 4'5 to 5'0 and location to be dropdown and populate it with cities entered by users while registering.Now they r textboxes except height – Shrinidhi Kulkarni Mar 28 '14 at 07:40
  • height is dropdown. Thank u. – Shrinidhi Kulkarni Mar 28 '14 at 07:42
  • This is a purely views issue, but you'll be able to set that as a "grouped filter" where you can choose the options that users can select to filter the ranges. However, this will only work well if you have the fields stored as integers. Views won't know what 5'9" means, let alone that it's higher than 4'11". – Andie Hunt Apr 01 '14 at 13:28
  • I tried using grouped filter(for integer i.e salary field) but there how can u specify range?? U can give only one value for label and value... – Shrinidhi Kulkarni Apr 03 '14 at 04:40
  • Hey now things are working fine with views except image... I have to display an image stored in civicrm into drupal views. It displays only URL – Shrinidhi Kulkarni Apr 03 '14 at 13:16
  • You just use views to rewrite the output of the field to be `` – Andie Hunt Apr 03 '14 at 13:41
  • Man I am new to Drupal and programming.. Can you elaborate your answer. What is the file name that has to be edited in views module(there are many files) . How to locate the outputfield in that file – Shrinidhi Kulkarni Apr 04 '14 at 05:12
  • What do you mean by "your field token" what is that – Shrinidhi Kulkarni Apr 04 '14 at 06:12