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 »
  • Using CiviSchool (Moderators: Donald Lobo, Deepak Srivastava) »
  • Acquia db_prefix error?
Pages: [1]

Author Topic: Acquia db_prefix error?  (Read 1975 times)

journeyer

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Acquia db_prefix error?
November 23, 2010, 06:54:50 pm
Hi,

    I am starting to play with CiviSchool. I have drupal installed already (Acquia version based on Druapal 6.19) (PHP 5.2.14, MySql  5.0.51a). I am following the instructions to load the civischool data as mentioned in the sticky post. But I am getting db error - The table dbname.users does not exist.


Array
(
    [callback] => Array
        (
            \[0] => CRM_Core_Error
            [1] => handle
        )
 

    code] => -18
    [message] => DB Error: no such table
    [mode] => 16
    [debug_info] => SELECT u.* FROM users u WHERE LOWER(u.name) = 'admin' AND u.pass = 'XXXX' AND u.status = 1 [nativecode=1146 ** Table 'dbname.users' doesn't exist]
    [type] => DB_Error
    [user_info] => SELECT u.* FROM users u WHERE LOWER(u.name) = 'admin' AND u.pass = 'XXXX' AND u.status = 1 [nativecode=1146 ** Table 'dbname.users' doesn't exist]
    [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT u.* FROM users u WHERE LOWER(u.name) = 'admin' AND u.pass = 'XXXX' AND u.status = 1 [nativecode=1146 ** Table 'dbname.users' doesn't exist]"]

I think the db_prefix is somehow not getting handled properly. (It is "acquia_" BTW).

What could be the error ?

Thanks!
Amit

Kiran Jagtap

  • Ask me questions
  • ****
  • Posts: 533
  • Karma: 51
Re: Acquia db_prefix error?
November 25, 2010, 04:24:19 am
could u try to update query and replaced 'users' w/ {users}

so your query might be look like

Code: [Select]
       
$sql  = "SELECT u.* FROM {users} u WHERE LOWER(u.name) = 'admin' AND u.pass = 'XXXX' AND u.status = 1";
$result = db_query( $sql );
userValue = db_fetch_object( $result );
CRM_Core_Error::debug( '$userValue', $userValue );
exit( );
       
hope this help

kiran
You Are Designed To Choose... Defined By Choice.

journeyer

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Re: Acquia db_prefix error?
November 25, 2010, 01:11:16 pm
Thanks Kiran. The name of the table should actually be acquia_users. Somehow the code is not using the db_prefix value from drupal settings. I am trying to figure out the place which calls this query. Can you tell me where can I modify the query ?

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: Acquia db_prefix error?
November 25, 2010, 03:34:04 pm

check:

http://drupal.demo.civicrm.org/civicrm/admin/setting/uf&reset=1

I think its fairly trivial to make civicrm smart enough to figure out what the users table is. Wanna investigate and file a patch so we can avoid storing it in our db

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

journeyer

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Re: Acquia db_prefix error?
December 10, 2010, 11:21:05 am
Thanks Lobo. That seemed to have worked. I didn't have the right tablename set there. The import went okay...

Thanks!
Amit

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Using CiviSchool (Moderators: Donald Lobo, Deepak Srivastava) »
  • Acquia db_prefix error?

This forum was archived on 2017-11-26.