CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • CiviCRM - Views Troubleshooting advice please
Pages: [1]

Author Topic: CiviCRM - Views Troubleshooting advice please  (Read 3116 times)

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
CiviCRM - Views Troubleshooting advice please
September 06, 2009, 12:36:24 pm
I get the following two user warnings:

Code: [Select]
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax
to use near '-iw-civicrm.civicrm_event civicrm_event WHERE ((civicrm_event.is_active <> 0) ' at line 4 query: SELECT civicrm_event.id AS id,
civicrm_event.start_date AS civicrm_event_start_date, civicrm_event.title AS civicrm_event_title FROM dev-iw-civicrm.civicrm_event civicrm_event
WHERE ((civicrm_event.is_active <> 0) AND (civicrm_event.is_public <> 0)) AND ((DATE_FORMAT(CONVERT_TZ(civicrm_event.start_date, 'UTC',
'America/Los_Angeles'), '%Y-%m') <= '2009-09' AND DATE_FORMAT(CONVERT_TZ(civicrm_event.start_date, 'UTC', 'America/Los_Angeles'), '%Y-%m')
>= '2009-09')) ORDER BY civicrm_event_start_date ASC in ####/modules/acquia/views/includes/view.inc on line 759.

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'-iw-civicrm.civicrm_event civicrm_event WHERE ((civicrm_event.is_active <> 0) ' at line 4 query: SELECT civicrm_event.id AS id, civicrm_event.start_date
AS civicrm_event_start_date, civicrm_event.title AS civicrm_event_title FROM dev-iw-civicrm.civicrm_event civicrm_event WHERE ((civicrm_event.is_active
<> 0) AND (civicrm_event.is_public <> 0)) AND ((DATE_FORMAT(CONVERT_TZ(civicrm_event.start_date, 'UTC', 'America/Los_Angeles'), '%Y-%m') <= '2009-09'
AND DATE_FORMAT(CONVERT_TZ(civicrm_event.start_date, 'UTC', 'America/Los_Angeles'), '%Y-%m') >= '2009-09')) ORDER BY civicrm_event_start_date ASC
in ####/modules/acquia/views/includes/view.inc on line 759.

Any advice on how to interpret, troubleshoot? My thinking so far:

1. What it means
My MYSQL version doesn't like the SQL statements.

2. Troubleshooting strategy:
donwgrade my MYSQL version and see if the problem goes away.

Anybody else have other thoughts or ideas I could try?


Additional background:
Drupal and CiviCRM have seperate dbs
I got the db prefix statement from the CiviCRM URL and edited the settings.php file
drupal user has privileges to the civicrm db
« Last Edit: September 06, 2009, 12:47:08 pm by geilhufe »
Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: CiviCRM - Views Troubleshooting advice please
September 06, 2009, 05:38:03 pm

can you cut-n-paste the sql in a mysql command line (or PHPMyAdmin if you prefer) and see if it gives you an error

most likely it seems that it does not like the '-' (hyphen) in your db name (dev-iw-civicrm) can u change that to an underscore

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

geilhufe

  • I post frequently
  • ***
  • Posts: 293
  • Karma: 33
    • Social Source Software
Re: CiviCRM - Views Troubleshooting advice please
September 06, 2009, 09:54:01 pm
As always, lobo is right :)
Didn't like my db names.

For others struggling with this (it is really very easy when it works):
http://wiki.civicrm.org/confluence/display/CRMDOC/Views2+Integration+Module

And I added a quick step by step guide to that page.
Drupal and CiviCRM consulting, strategy and configuration
http://www.social-source.com/

Danny_Joris

  • Guest
Re: CiviCRM - Views Troubleshooting advice please
August 23, 2010, 01:37:38 am
Yes! I had the same problem. Thanks for pointing out the solution!

It's a detail, but very important.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • CiviCRM - Views Troubleshooting advice please

This forum was archived on 2017-11-26.