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 »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Throwing errors as if SQL table is not there?
Pages: [1]

Author Topic: Throwing errors as if SQL table is not there?  (Read 2010 times)

JMOmandown

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7
  • MySQL version: Latest
  • PHP version: Latest
Throwing errors as if SQL table is not there?
March 05, 2012, 04:37:09 pm
Drupal 7
CiviCRM 4.1.0
Separate DB as Recommended

I am throwing multiple errors in multiple places.  Re-installed, I am sure that the installation was correct.  I pulled the code right from the code snippets as a test and drew the following two errors. home and username removed since forums are reading it as a link

Parse error: syntax error, unexpected T_VARIABLE in php.module(80) : eval()'d code on line 10

SELECT civicrm_contribution.contact_id, SUM( civicrm_contribution.total_amount ) as total_amount FROM civicrm_contribution WHERE civicrm_contribution.receive_date >= '2005-04-20' AND civicrm_contribution.receive_date <= '2006-10-20' AND civicrm_contribution.contribution_type_id = 4 AND civicrm_contribution.cancel_date IS NULL GROUP BY civicrm_contribution.contact_id

I also receive the following error when trying to call fields from views

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'soldie9_cms.civicrm_contribution' doesn't exist

I have installed older versions of CiviCRM in the past in the same fashion without any issues.  Thank you for your help in advance, you guys are always extremely responsive.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Throwing errors as if SQL table is not there?
March 06, 2012, 06:33:31 am
I would need to see more of your code to see what's wrong there. All you posted in SQL code, which certainly isn't valid (like that) in a PHP code snippet.

Regarding Table 'soldie9_cms.civicrm_contribution', it looks like that's your CMS database, nor your CRM one. Did you follow all of the steps for Views Integration?
« Last Edit: March 06, 2012, 06:42:07 am by Hershel »
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

JMOmandown

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7
  • MySQL version: Latest
  • PHP version: Latest
Re: Throwing errors as if SQL table is not there?
March 06, 2012, 08:18:36 am
I had in a previous version and that kinda is the issue here: even trying to redo the view integration as described by the instructions it throws the undefined function error on step 3 for civicrm_group_get() (line 28).

The issue is that it is calling a table from soldie9_cms instead of soldie9_crm

I reviewed my civicrm.setting.php file and the information is correct.  I also double checked that the user had full access to the DB, which it does.  CiviCrm also works flawlessly except for this function to my knowledge.  What sort of information/code can I provide to further help with diagnosis of the problem?
« Last Edit: March 06, 2012, 08:23:35 am by JMOmandown »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Throwing errors as if SQL table is not there?
March 06, 2012, 09:40:22 am
Post your settings.php file. Change just the passwords.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

JMOmandown

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7
  • MySQL version: Latest
  • PHP version: Latest
Re: Throwing errors as if SQL table is not there?
March 06, 2012, 03:13:26 pm
Code: [Select]
<?php

$databases 
= array (
  
'default' => 
  array (
    
'default' => 
    array (
      
'database' => 'soldie9_cms',
      
'username' => 'username',
      
'password' => 'password',
      
'host' => 'localhost',
      
'port' => '',
      
'driver' => 'mysql',
      
'prefix' => '',
    ),
  ),
);

$databases['default']['default']['prefix']= array(
  
'civicrm_acl'                              => '`soldie9_crm`.',
  
'civicrm_acl_cache'                        => '`soldie9_crm`.',
  
'civicrm_acl_contact_cache'                => '`soldie9_crm`.',
  
'civicrm_acl_entity_role'                  => '`soldie9_crm`.',
  
'civicrm_action_log'                       => '`soldie9_crm`.',
  
'civicrm_action_mapping'                   => '`soldie9_crm`.',
  
'civicrm_action_schedule'                  => '`soldie9_crm`.',
  
'civicrm_activity'                         => '`soldie9_crm`.',
  
'civicrm_activity_assignment'              => '`soldie9_crm`.',
  
'civicrm_activity_target'                  => '`soldie9_crm`.',
  
'civicrm_address'                          => '`soldie9_crm`.',
  
'civicrm_address_format'                   => '`soldie9_crm`.',
  
'civicrm_batch'                            => '`soldie9_crm`.',
  
'civicrm_cache'                            => '`soldie9_crm`.',
  
'civicrm_campaign'                         => '`soldie9_crm`.',
  
'civicrm_campaign_group'                   => '`soldie9_crm`.',
  
'civicrm_case'                             => '`soldie9_crm`.',
  
'civicrm_case_activity'                    => '`soldie9_crm`.',
  
'civicrm_case_contact'                     => '`soldie9_crm`.',
  
'civicrm_component'                        => '`soldie9_crm`.',
  
'civicrm_contact'                          => '`soldie9_crm`.',
  
'civicrm_contact_type'                     => '`soldie9_crm`.',
  
'civicrm_contribution'                     => '`soldie9_crm`.',
  
'civicrm_contribution_page'                => '`soldie9_crm`.',
  
'civicrm_contribution_product'             => '`soldie9_crm`.',
  
'civicrm_contribution_recur'               => '`soldie9_crm`.',
  
'civicrm_contribution_soft'                => '`soldie9_crm`.',
  
'civicrm_contribution_type'                => '`soldie9_crm`.',
  
'civicrm_contribution_widget'              => '`soldie9_crm`.',
  
'civicrm_country'                          => '`soldie9_crm`.',
  
'civicrm_county'                           => '`soldie9_crm`.',
  
'civicrm_currency'                         => '`soldie9_crm`.',
  
'civicrm_custom_field'                     => '`soldie9_crm`.',
  
'civicrm_custom_group'                     => '`soldie9_crm`.',
  
'civicrm_dashboard'                        => '`soldie9_crm`.',
  
'civicrm_dashboard_contact'                => '`soldie9_crm`.',
  
'civicrm_dedupe_exception'                 => '`soldie9_crm`.',
  
'civicrm_dedupe_rule'                      => '`soldie9_crm`.',
  
'civicrm_dedupe_rule_group'                => '`soldie9_crm`.',
  
'civicrm_discount'                         => '`soldie9_crm`.',
  
'civicrm_domain'                           => '`soldie9_crm`.',
  
'civicrm_email'                            => '`soldie9_crm`.',
  
'civicrm_entity_batch'                     => '`soldie9_crm`.',
  
'civicrm_entity_file'                      => '`soldie9_crm`.',
  
'civicrm_entity_financial_trxn'            => '`soldie9_crm`.',
  
'civicrm_entity_tag'                       => '`soldie9_crm`.',
  
'civicrm_event'                            => '`soldie9_crm`.',
  
'civicrm_event_carts'                      => '`soldie9_crm`.',
  
'civicrm_events_in_carts'                  => '`soldie9_crm`.',
  
'civicrm_file'                             => '`soldie9_crm`.',
  
'civicrm_financial_account'                => '`soldie9_crm`.',
  
'civicrm_financial_trxn'                   => '`soldie9_crm`.',
  
'civicrm_grant'                            => '`soldie9_crm`.',
  
'civicrm_group'                            => '`soldie9_crm`.',
  
'civicrm_group_contact'                    => '`soldie9_crm`.',
  
'civicrm_group_contact_cache'              => '`soldie9_crm`.',
  
'civicrm_group_nesting'                    => '`soldie9_crm`.',
  
'civicrm_group_organization'               => '`soldie9_crm`.',
  
'civicrm_im'                               => '`soldie9_crm`.',
  
'civicrm_job'                              => '`soldie9_crm`.',
  
'civicrm_job_log'                          => '`soldie9_crm`.',
  
'civicrm_line_item'                        => '`soldie9_crm`.',
  
'civicrm_loc_block'                        => '`soldie9_crm`.',
  
'civicrm_location_type'                    => '`soldie9_crm`.',
  
'civicrm_log'                              => '`soldie9_crm`.',
  
'civicrm_mail_settings'                    => '`soldie9_crm`.',
  
'civicrm_mailing'                          => '`soldie9_crm`.',
  
'civicrm_mailing_bounce_pattern'           => '`soldie9_crm`.',
  
'civicrm_mailing_bounce_type'              => '`soldie9_crm`.',
  
'civicrm_mailing_component'                => '`soldie9_crm`.',
  
'civicrm_mailing_event_bounce'             => '`soldie9_crm`.',
  
'civicrm_mailing_event_confirm'            => '`soldie9_crm`.',
  
'civicrm_mailing_event_delivered'          => '`soldie9_crm`.',
  
'civicrm_mailing_event_forward'            => '`soldie9_crm`.',
  
'civicrm_mailing_event_opened'             => '`soldie9_crm`.',
  
'civicrm_mailing_event_queue'              => '`soldie9_crm`.',
  
'civicrm_mailing_event_reply'              => '`soldie9_crm`.',
  
'civicrm_mailing_event_subscribe'          => '`soldie9_crm`.',
  
'civicrm_mailing_event_trackable_url_open' => '`soldie9_crm`.',
  
'civicrm_mailing_event_unsubscribe'        => '`soldie9_crm`.',
  
'civicrm_mailing_group'                    => '`soldie9_crm`.',
  
'civicrm_mailing_job'                      => '`soldie9_crm`.',
  
'civicrm_mailing_recipients'               => '`soldie9_crm`.',
  
'civicrm_mailing_spool'                    => '`soldie9_crm`.',
  
'civicrm_mailing_trackable_url'            => '`soldie9_crm`.',
  
'civicrm_mapping'                          => '`soldie9_crm`.',
  
'civicrm_mapping_field'                    => '`soldie9_crm`.',
  
'civicrm_membership'                       => '`soldie9_crm`.',
  
'civicrm_membership_block'                 => '`soldie9_crm`.',
  
'civicrm_membership_log'                   => '`soldie9_crm`.',
  
'civicrm_membership_payment'               => '`soldie9_crm`.',
  
'civicrm_membership_status'                => '`soldie9_crm`.',
  
'civicrm_membership_type'                  => '`soldie9_crm`.',
  
'civicrm_menu'                             => '`soldie9_crm`.',
  
'civicrm_navigation'                       => '`soldie9_crm`.',
  
'civicrm_note'                             => '`soldie9_crm`.',
  
'civicrm_openid'                           => '`soldie9_crm`.',
  
'civicrm_option_group'                     => '`soldie9_crm`.',
  
'civicrm_option_value'                     => '`soldie9_crm`.',
  
'civicrm_participant'                      => '`soldie9_crm`.',
  
'civicrm_participant_payment'              => '`soldie9_crm`.',
  
'civicrm_participant_status_type'          => '`soldie9_crm`.',
  
'civicrm_payment_processor'                => '`soldie9_crm`.',
  
'civicrm_payment_processor_type'           => '`soldie9_crm`.',
  
'civicrm_pcp'                              => '`soldie9_crm`.',
  
'civicrm_pcp_block'                        => '`soldie9_crm`.',
  
'civicrm_persistent'                       => '`soldie9_crm`.',
  
'civicrm_phone'                            => '`soldie9_crm`.',
  
'civicrm_pledge'                           => '`soldie9_crm`.',
  
'civicrm_pledge_block'                     => '`soldie9_crm`.',
  
'civicrm_pledge_payment'                   => '`soldie9_crm`.',
  
'civicrm_preferences_date'                 => '`soldie9_crm`.',
  
'civicrm_premiums'                         => '`soldie9_crm`.',
  
'civicrm_premiums_product'                 => '`soldie9_crm`.',
  
'civicrm_prevnext_cache'                   => '`soldie9_crm`.',
  
'civicrm_price_field'                      => '`soldie9_crm`.',
  
'civicrm_price_field_value'                => '`soldie9_crm`.',
  
'civicrm_price_set'                        => '`soldie9_crm`.',
  
'civicrm_price_set_entity'                 => '`soldie9_crm`.',
  
'civicrm_product'                          => '`soldie9_crm`.',
  
'civicrm_project'                          => '`soldie9_crm`.',
  
'civicrm_relationship'                     => '`soldie9_crm`.',
  
'civicrm_relationship_type'                => '`soldie9_crm`.',
  
'civicrm_report_instance'                  => '`soldie9_crm`.',
  
'civicrm_saved_search'                     => '`soldie9_crm`.',
  
'civicrm_setting'                          => '`soldie9_crm`.',
  
'civicrm_state_province'                   => '`soldie9_crm`.',
  
'civicrm_subscription_history'             => '`soldie9_crm`.',
  
'civicrm_survey'                           => '`soldie9_crm`.',
  
'civicrm_tag'                              => '`soldie9_crm`.',
  
'civicrm_task'                             => '`soldie9_crm`.',
  
'civicrm_task_status'                      => '`soldie9_crm`.',
  
'civicrm_tell_friend'                      => '`soldie9_crm`.',
  
'civicrm_timezone'                         => '`soldie9_crm`.',
  
'civicrm_uf_field'                         => '`soldie9_crm`.',
  
'civicrm_uf_group'                         => '`soldie9_crm`.',
  
'civicrm_uf_join'                          => '`soldie9_crm`.',
  
'civicrm_uf_match'                         => '`soldie9_crm`.',
  
'civicrm_value_constituent_information_1'  => '`soldie9_crm`.',
  
'civicrm_value_donor_information_3'        => '`soldie9_crm`.',
  
'civicrm_value_food_preference_2'          => '`soldie9_crm`.',
  
'civicrm_website'                          => '`soldie9_crm`.',
  
'civicrm_worldregion'                      => '`soldie9_crm`.',
);

$update_free_access = FALSE;
$drupal_hash_salt = 'gYfg0y61wLVRSA3GTDoc-BvgDEl5tQlTCQ_6_-QVoGI';
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);
ini_set('session.gc_maxlifetime', 200000);
ini_set('session.cookie_lifetime', 2000000);
# ini_set('pcre.backtrack_limit', 200000);
# ini_set('pcre.recursion_limit', 200000);
# $cookie_domain = '.example.com';
# $conf['site_name'] = 'My Drupal site';
# $conf['theme_default'] = 'garland';
# $conf['anonymous'] = 'Visitor';
# $conf['maintenance_theme'] = 'bartik';
# $conf['reverse_proxy'] = TRUE;
# $conf['reverse_proxy_addresses'] = array('a.b.c.d', ...);
# $conf['reverse_proxy_header'] = 'HTTP_X_CLUSTER_CLIENT_IP';
# $conf['omit_vary_cookie'] = TRUE;
# $conf['css_gzip_compression'] = FALSE;
# $conf['js_gzip_compression'] = FALSE;

# $conf['locale_custom_strings_en'][''] = array(
#   'forum'      => 'Discussion board',
#  '@count min' => '@count minutes',
# );

# $conf['blocked_ips'] = array(
#   'a.b.c.d',
# );

$conf['404_fast_paths_exclude'] = '/\/(?:styles)\//';
$conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';
$conf['404_fast_html'] = '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>';


# drupal_fast_404();
# $conf['allow_authorize_operations'] = FALSE;

Code: [Select]
<?php

define
( 'CIVICRM_UF'               , 'Drupal'        );
define( 'CIVICRM_UF_DSN'           , 'mysql://username:password@localhost/soldie9_cms?new_link=true' );
define( 'CIVICRM_DSN'          , 'mysql://username:password@localhost/soldie9_crm?new_link=true' );
define('CIVICRM_LOGGING_DSN', CIVICRM_DSN);

global 
$civicrm_root;

$civicrm_root = '/home/soldie9/public_html/sites/all/modules/civicrm';
define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/home/soldie9/public_html/sites/default/files/civicrm/templates_c/' );
define( 'CIVICRM_UF_BASEURL'      , 'http://soldiersofdestiny.net/' );
define( 'CIVICRM_SITE_KEY', 'changed didn't know if this was ok to post?' );
define( '
CIVICRM_IDS_ENABLE', 1);
define( '
CIVICRM_MAIL_SMARTY', 0 );
// define( '
CIVICRM_MAIL_LOG', '/home/soldie9/public_html/sites/default/files/civicrm/templates_c//mail.log' );

define( 'CIVICRM_DOMAIN_ID'      , 1 );
define( 'CIVICRM_USE_MEMCACHE', 0 );
define( 'CIVICRM_MEMCACHE_HOST', 'localhost' );
define( 'CIVICRM_MEMCACHE_PORT', 11211 );
define( 'CIVICRM_MEMCACHE_TIMEOUT', 3600 );
define( 'CIVICRM_MEMCACHE_PREFIX', '' );

$include_path = '.'        . PATH_SEPARATOR .
                
$civicrm_root . PATH_SEPARATOR .
                
$civicrm_root . DIRECTORY_SEPARATOR . 'packages' . PATH_SEPARATOR .
                
get_include_path( );
set_include_path( $include_path );

if ( 
function_exists( 'variable_get' ) && variable_get('clean_url', '0') != '0' ) {
    
define( 'CIVICRM_CLEANURL', 1 );
} else {
    
define( 'CIVICRM_CLEANURL', 0 );
}

ini_set('auto_detect_line_endings', '1');

$memLimitString = trim(ini_get('memory_limit'));
$memLimitUnit   = strtolower(substr($memLimitString, -1));
$memLimit       = (int) $memLimitString;
switch (
$memLimitUnit) {
    case 
'g': $memLimit *= 1024;
    case 
'm': $memLimit *= 1024;
    case 
'k': $memLimit *= 1024;
}
if (
$memLimit >= 0 and $memLimit < 134217728) {
    
ini_set('memory_limit', '128M');
}
« Last Edit: March 06, 2012, 03:20:56 pm by JMOmandown »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Throwing errors as if SQL table is not there?
March 06, 2012, 11:21:25 pm
Your code looks correct. You wrote:

> I pulled the code right from the code snippets as a test

Can you post this code, verbatim?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

JMOmandown

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7
  • MySQL version: Latest
  • PHP version: Latest
Re: Throwing errors as if SQL table is not there?
March 07, 2012, 11:45:27 am
straight from the examples section.  As said before and call to civicrm is giving me the aforementioned error (I completely reinstalled from scratch and this fixed views but still cannot call with php)

Code: [Select]

<?php
 
 
 
// Check if CiviCRM is installed here.
 
if (!module_exists('civicrm')) return false;
 
// Initialization call is required to use CiviCRM APIs.
 
civicrm_initialize( );
 
// hack $select
 
$select = "
 
  SELECT civicrm_contribution.contact_id,
 
  SUM( civicrm_contribution.total_amount ) as total_amount
 
  FROM civicrm_contribution
 
  WHERE civicrm_contribution.receive_date >= '2005-04-20'
 
  AND civicrm_contribution.receive_date <= '2006-10-20'
 
  AND civicrm_contribution.contribution_type_id = 4
 
  AND civicrm_contribution.cancel_date IS NULL
 
  GROUP BY civicrm_contribution.contact_id "
;
 
$query  = $select;
 
$params = array( );
 
print 
$query . "\n\n";
 
$dao =& CRM_Core_DAO::executeQuery( $query, $params );
 
while ( 
$dao->fetch( ) ) {
 
  
// Contact API returns contact info
  
$cg = array( 'contact_id' => $dao->contact_id );
  
$contact = civicrm_contact_get( $cg );
 
  echo 
"'" . $contact['sort_name'] . "',";
 
  echo 
"'" . $contact['display_name'] . "',";
 
  echo 
"'" . $dao->contact_id ."',";
 
  echo 
"'" . $dao->total_amount . "'<br />\r\n";
 
  }
 
?>


Two more errors I found with my installation (even though this is a fresh one), I am unable to edit any users.  The page loads with no content.  And views is now working with a fresh install but throwing Notices.  I reviewed my installation thoroughly and found no issues with the way the install was performed.  It was done verbatim from the instructions

« Last Edit: March 07, 2012, 09:02:19 pm by JMOmandown »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Throwing errors as if SQL table is not there?
March 08, 2012, 03:34:03 pm
Quote
Two more errors I found with my installation (even though this is a fresh one), I am unable to edit any users.  The page loads with no content.

You can't edit users or Contacts? If Contacts, check Firebug and look for an error there.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

JMOmandown

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7
  • MySQL version: Latest
  • PHP version: Latest
Re: Throwing errors as if SQL table is not there?
March 08, 2012, 09:02:05 pm
Firebug found no error.  I attempted the task on other computers as well with no success.  Led me to believe it was something with 1) the server, 2) Drupal, 3) or CiviCRM install.  So I cleared the server and re-installed both civiCRM and Drupal from scratch this time.  Seemed to fix the errors (reloaded all the sql data).  Only problem I have left is the view integration throwing Notices about an Un-defined index of group_type when making the query call to CiviCRM contribute.  Simply it is only calling two field out of Personal Campaign Pages: Amount Raised and Title..

Almost all squared away!  ;D
On a side note: very happy with CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Throwing errors as if SQL table is not there?

This forum was archived on 2017-11-26.