Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2009
    Posts
    110
    Plugin Contributions
    0

    database error Error message trying to connnect to database

    Hi,

    Hostgator inadvertently deleted my friend's store She's reinstalled it, but the database was ok. The main store is working ok, but when we try to log into the admin area, we get the following message:

    Code:
    PHP Fatal error:  Call to undefined method queryFactory::Execute() in /home4/lngstore/public_html/shop/lngstore_admin/includes/init_includes/init_db_config_read.php on line 13
    The code for that file is:

    Code:
    <?php
    /**
     * @package admin
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: init_db_config_read.php 3001 2006-02-09 21:45:06Z wilt $
     */
    if (!defined('IS_ADMIN_FLAG')) {
      die('Illegal Access');
    }
    // Determine the DATABASE patch level
      $project_db_info = $db->Execute("select * from " . TABLE_PROJECT_VERSION . " WHERE project_version_key = 'Zen-Cart Database' ");
      define('PROJECT_DB_VERSION_MAJOR',$project_db_info->fields['project_version_major']);
      define('PROJECT_DB_VERSION_MINOR',$project_db_info->fields['project_version_minor']);
      define('PROJECT_DB_VERSION_PATCH1',$project_db_info->fields['project_version_patch1']);
      define('PROJECT_DB_VERSION_PATCH2',$project_db_info->fields['project_version_patch2']);
      define('PROJECT_DB_VERSION_PATCH1_SOURCE',$project_db_info->fields['project_version_patch1_source']);
      define('PROJECT_DB_VERSION_PATCH2_SOURCE',$project_db_info->fields['project_version_patch2_source']);
    
    // set application wide parameters
      $configuration = $db->Execute('select configuration_key as cfgKey, configuration_value as cfgValue
                                     from ' . TABLE_CONFIGURATION);
      while (!$configuration->EOF) {
        define($configuration->fields['cfgKey'], $configuration->fields['cfgValue']);
        $configuration->MoveNext();
      }
    
    // set product type layout paramaters
      $configuration = $db->Execute('select configuration_key as cfgKey, configuration_value as cfgValue
                              from ' . TABLE_PRODUCT_TYPE_LAYOUT);
    
      while (!$configuration->EOF) {
        define($configuration->fields['cfgKey'], $configuration->fields['cfgValue']);
        $configuration->movenext();
      }
    ?>
    The red code is line 13.
    We can't figure out what is wrong - can someone please help us quickly, as the store has already been down for a couple of days.

  2. #2
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Error message trying to connnect to database

    when you look at the table it's telling you in that line of code 'product_version' in the database what do you see?

    i see this:
    Name:  db_product_version.jpg
Views: 231
Size:  9.4 KB
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  3. #3
    Join Date
    Jul 2009
    Posts
    110
    Plugin Contributions
    0

    Default Re: Error message trying to connnect to database

    Looks just like yours except for the date

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,879
    Plugin Contributions
    96

    Default Re: Error message trying to connnect to database

    Are there any debug-log files in the store's /cache directory? The error you're getting leads me to believe that the initialization of the $db object has somehow failed.

  5. #5
    Join Date
    Jul 2009
    Posts
    110
    Plugin Contributions
    0

    Default Re: Error message trying to connnect to database

    There are two files in there - here they are - removing the password info etc.

    Code:
    installerConfigKeys|a:10:{s:8:"language";s:7:"english";s:16:"DIR_FS_SQL_CACHE";s:38:"/home4/lngstore/public_html/shop/cache";s:10:"is_upgrade";s:1:"1";s:7:"DB_TYPE";s:5:"mysql";s:10:"DB_CHARSET";s:4:"utf8";s:9:"DB_PREFIX";s:0:"";s:9:"DB_SERVER";s:9:"localhost";s:18:"DB_SERVER_USERNAME";s:14:"xxxxxxx";s:18:"DB_SERVER_PASSWORD";s:24:"xxxxxxxxxxxxxxxx";s:11:"DB_DATABASE";s:15:"lngstore_lng150";}logfilename|s:27:"Dec-28-2013_03-16-01-px0lM8";installerConfigInfo|a:0:{}
    Code:
    installerConfigKeys|a:1:{s:8:"language";s:7:"english";}
    I don't know what all that means :S

    Thanks,
    Joanne

  6. #6
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Error message trying to connnect to database

    First double check all of the settings in both "configure.php" files to ensure all the filesystem paths are correct. If nothing jumps out, try this (and let us know what happens):
    1. Grab a "clean" copy of Zen Cart 1.5.0
    2. Upload the "/admin" folder (use another name, different from your current admin folder name)
    3. Copy "/current_admin_folder/includes/configure.php" to "/test_admin_folder/includes/configure.php".
    4. If you upgraded from 1.3.9x, you may need to edit the "configure.php" to fix filesystem paths (to reflect the new path to "/test_admin_folder"). Keep in mind this file is usually readonly, so you may need to change permissions to edit the file.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  7. #7
    Join Date
    Jul 2009
    Posts
    110
    Plugin Contributions
    0

    Default Re: Error message trying to connnect to database

    It's resolved now, she just totally reinstalled 1.5

 

 

Similar Threads

  1. Error Message when Trying to Restrict Coupons
    By rainbows in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 13
    Last Post: 19 Apr 2011, 11:36 PM
  2. error message when trying to checkout
    By sflasal in forum General Questions
    Replies: 1
    Last Post: 3 Feb 2011, 02:46 AM
  3. Error message when trying to run upgrade 1.3.7 to 1.3.8
    By huwmac in forum Upgrading from 1.3.x to 1.3.9
    Replies: 5
    Last Post: 10 Apr 2008, 08:24 AM
  4. Error Message - Trying to install modules
    By Kellie14 in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 1 Nov 2007, 06:38 AM
  5. Error Message when trying to create account
    By kimberlyeddy in forum Managing Customers and Orders
    Replies: 14
    Last Post: 5 Aug 2007, 04:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg