Page 1 of 3 123 LastLast
Results 1 to 10 of 30
  1. #1
    Join Date
    Dec 2008
    Posts
    64
    Plugin Contributions
    0

    Default query_factory.php on line 46 errors when upgrade from 150 to 151

    Hi Guys,
    Just updated to 151 from 150.

    I am getting the below error log. I did have http://www.data-diggers.com/links-to...ti-and-others/ Query Cache installed but I have overwritten these files (includes/classes/db/mysql/query_factory.php and includes/functions/functions_catagories.php) with the 151 versions.

    [24-Sep-2012 21:13:12] PHP Parse error: syntax error, unexpected $end, expecting ')' in /home/nuganics/public_html/includes/classes/db/mysql/query_factory.php on line 46


    I think line 46 in query_factory.php is
    function connect($zf_host, $zf_user, $zf_password, $zf_database, $zf_pconnect = 'false', $zp_real = false) {


    The site still loads as long as I use 150 version of /includes/auto_loaders/config.core.php and not the latest 151 version.

    Kind regards
    Tim

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: query_factory.php on line 46 errors when upgrade from 150 to 151

    The query_factory.php file in Zen Cart v1.5.1 contains over 500 lines in it. Your error message says yours ends on line 46.
    Sounds like a bad upload from your FTP program, or your site is using files that didn't come with original Zen Cart code.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Dec 2008
    Posts
    64
    Plugin Contributions
    0

    Default Re: query_factory.php on line 46 errors when upgrade from 150 to 151

    Thank you for the reply DrByte. query_factory.php has 538 lines and the correct version in the header (viewed via ftp and deleted and uploaded again just to be sure). I just switched /includes/auto_loaders/config.core.php to the 151 version and I got the below errors also. init_canonical.php might not be a real error.

    [24-Sep-2012 21:45:09] PHP Fatal error: Cannot redeclare class QueryCache in /home/nuganics/public_html/includes/classes/query_cache.php on line 16

    which is class QueryCache {

    [24-Sep-2012 21:44:43] PHP Fatal error: Call to undefined function zen_href_link() in ... various files

    I reuploaded all the files again and I get 500 error as soon as I upload 151 version of /includes/auto_loaders/config.core.php and I get /includes/classes/query_cache.php on line 16 errors in log file folder.

    The below files I didn't copy over into my active template but I don't think that will be a issue. I also looked at all the extensions I installed to see if any need to be fixed on for the new files uploaded but no changed as just cosmetic.

    /includes/languages/english/html_includes/classic/define_main_page.php
    /includes/languages/english/html_includes/define_main_page.php
    /includes/templates/template_default/common/html_header.php
    /includes/templates/template_default/common/tpl_header.php
    /includes/templates/template_default/popup_search_help/tpl_main_page.php
    /includes/templates/template_default/templates/tpl_account_default.php
    /includes/templates/template_default/templates/tpl_contact_us_default.php
    /includes/templates/template_default/templates/tpl_modules_create_account.php
    /includes/templates/template_default/templates/tpl_product_reviews_write_default.php
    /includes/templates/template_default/templates/tpl_zc_install_suggested_default.php



    p.s would be great to have a 150 to 151 update pack

    Any other ideas?

    Kind regards
    Tim

  4. #4
    Join Date
    Dec 2008
    Posts
    64
    Plugin Contributions
    0

    Default Re: query_factory.php on line 46 errors when upgrade from 150 to 151

    In admin when I go to view the customers or orders I get "WARNING: An Error occurred, please refresh the page and try again."

    The error log is

    [24-Sep-2012 23:04:28] PHP Fatal error: 1064: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 'select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipp' at line 1 :: select count(select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, o.customers_company, o.customers_email_address, o.customers_street_address, o.delivery_company, o.delivery_name, o.delivery_street_address, o.billing_company, o.billing_name, o.billing_street_address, o.payment_module_code, o.shipping_module_code, o.ip_address
    from (zen_orders_status s, zen_orders o )
    left join zen_orders_total ot on (o.orders_id = ot.orders_id and ot.class = \'ot_total\')
    where (o.orders_status = s.orders_status_id and s.language_id = \'1\') order by o.orders_id DESC) as total in /home/nuganics/public_html/includes/classes/db/mysql/query_factory.php on line 120

    another one
    [24-Sep-2012 23:03:59] PHP Fatal error: 1064: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 'select p.order_id, p.paypal_ipn_id, p.txn_type, p.payment_type, p.payment_status' at line 1 :: select count(select p.order_id, p.paypal_ipn_id, p.txn_type, p.payment_type, p.payment_status, p.pending_reason, p.mc_currency, p.payer_status, p.mc_currency, p.date_added, p.mc_gross, p.first_name, p.last_name, p.payer_business_name, p.parent_txn_id, p.txn_id from zen_paypal as p left join zen_orders as o on o.orders_id = p.order_id order by p.paypal_ipn_id DESC) as total in /home/nuganics/public_html/includes/classes/db/mysql/query_factory.php on line 120


    another one
    [24-Sep-2012 23:03:55] PHP Fatal error: 1064: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 'select * from zen_group_pricing) as total' at line 1 :: select count(select * from zen_group_pricing) as total in /home/nuganics/public_html/includes/classes/db/mysql/query_factory.php on line 120


    Changing query_factory.php back to the 150 version doesn't fix it.

  5. #5
    Join Date
    Dec 2008
    Posts
    64
    Plugin Contributions
    0

    Default Re: query_factory.php on line 46 errors when upgrade from 150 to 151

    Server OS: Linux 3.2.28 Database: MySQL 5.5.23-55
    HTTP Server: Apache
    PHP Version: 5.2.17 (Zend: 2.2.0) PHP Memory Limit: 256M PHP Safe Mode: Off
    PHP File Uploads: On Max Size: 64M POST Max Size: 64M

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

    Default Re: query_factory.php on line 46 errors when upgrade from 150 to 151

    For those previously using Query Cache
    The Zen Cart 1.5.1 version of Query Cache is quite a bit different from the version(s) released by data-diggers. Especially in terms of customized zen-cart files. It is not simply a "drag 1.5.1 files and overwrite". My advice is to remove the old data-diggers Query Cache files first.

    What I ended up doing
    Start with clean versions of all the Zen Cart 1.5.1 files. This includes removing customizations made to core Zen Cart files for older installations of Query_Cache and Query_Log. Then do a manual merge of all the files not including any changes from the previously installed Query Cache.

    This also includes removing the qc_ functions which provide in memory caching... Site performance was better in my experience without these being used. Also I would advocate towards using the built-in mechanisms in Zen Cart 1.5 to provide local (in memory, database, file) caching where needed or desired.

    Going through this process took care of all the issues I saw initially on my development site - the blank pages - SQL errors - missing content. I did also need to make a small set of patches for my environment - see the note below.

    Quote Originally Posted by nuganics View Post
    [24-Sep-2012 21:45:09] PHP Fatal error: Cannot redeclare class QueryCache in /home/nuganics/public_html/includes/classes/query_cache.php on line 16
    Did you remove the autoloader and init_include files from the old Query Cache plugin / module?

    Note:
    If you also have defined 'SQL_CACHE_METHOD' in your configuration (or admin configuration) you may want to look at http://www.zen-cart.com/showthread.p...-Query-Factory - It contains some changes I ended up needing as I use both the query_cache and Zen Cart's built in cache.
    Last edited by lhungil; 25 Sep 2012 at 06:57 PM.

  7. #7
    Join Date
    Dec 2008
    Posts
    64
    Plugin Contributions
    0

    Default Re: query_factory.php on line 46 errors when upgrade from 150 to 151

    Thank you for the reply. Removing the data-diggers files did get rid of the 500 errors Cheers lhungil.

    I didn't have any data-diggers files in init_include files from the old Query Cache plugin / module.

    I didn't install Query_Log so hopefully all good there.

    I am still getting errors like the below when I go to view the customer or orders list.
    [25-Sep-2012 21:31:54] PHP Fatal error: 1064: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 'select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipp' at line 1 :: select count(select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total, o.customers_company, o.customers_email_address, o.customers_street_address, o.delivery_company, o.delivery_name, o.delivery_street_address, o.billing_company, o.billing_name, o.billing_street_address, o.payment_module_code, o.shipping_module_code, o.ip_address
    from (zen_orders_status s, zen_orders o )
    left join zen_orders_total ot on (o.orders_id = ot.orders_id and ot.class = \'ot_total\')
    where (o.orders_status = s.orders_status_id and s.language_id = \'1\') order by o.orders_id DESC) as total in /home/nuganics/public_html/includes/classes/db/mysql/query_factory.php on line 120


    /admin/includes/configure.php has the below.

    define('USE_PCONNECT', 'false');
    define('STORE_SESSIONS', 'db');
    // for STORE_SESSIONS, use 'db' for best support, or '' for file-based storage

    // The next 2 "defines" are for SQL cache support.
    // For SQL_CACHE_METHOD, you can select from: none, database, or file
    // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache
    // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
    // ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash
    define('SQL_CACHE_METHOD', 'none');
    define('DIR_FS_SQL_CACHE', '/home/nuganics/public_html/cache');

    I changed it to file storage ad relogged in but got the same errors.

    What should I try next as there are no more Query Cache plugin files?

    Kind regards
    Tim

  8. #8
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: query_factory.php on line 46 errors when upgrade from 150 to 151

    It appears you still have some left over code in your files. better check for code changes made for query factory
    Or maybe it is easier to just start with a clean 1.5.1 installation

  9. #9
    Join Date
    Dec 2008
    Posts
    64
    Plugin Contributions
    0

    Default Re: query_factory.php on line 46 errors when upgrade from 150 to 151

    Hi DrByte, lhungil, and Design75,
    Just want to say thank you for your replies. Not sure what I did just overwrote all /admin/ with 1.5.1 files and working fine. I must have edited a admin file.

    Thanks for the help.

    Kind regards
    Tim

  10. #10
    Join Date
    Aug 2007
    Posts
    277
    Plugin Contributions
    0

    Default Re: query_factory.php on line 46 errors when upgrade from 150 to 151

    ZC 1.5.1
    multisite
    Ultimate SEO

    I constantly have the similar errors in my log files. I always points to line 120. Two of the logs are below. I do not use "data diggers" (if data diggers is a mod that needs to be installed. never heard of what it is until in here)
    Can anyone tell me what is going wrong? MY sites does work but these error occasionally appears.


    one error log:

    [09-Nov-2013 06:21:22 America/New_York] PHP Fatal error: 2006:MySQL server has gone away :: select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id from (products p left join featured f on p.products_id = f.products_id left join products_description pd on p.products_id = pd.products_id) INNER JOIN categories_description cd
    ON (p.master_categories_id = cd.categories_id
    AND cd.language_id=1
    AND cd.categories_description LIKE '%-robbor_green_BAM-%') where p.products_id = f.products_id and p.products_id = pd.products_id and p.products_status = 1 and f.status = 1 and pd.language_id = '1' and p.products_id in (3208, 3209, 3210, 3211, 3212, 3213, 3214, 3215, 3216, 3217, 3218, 3219, 3220, 3221, 3222, 3223, 3224, 3225, 3226, 3227, 3228, 3229, 3230, 3231) in /data/14/1/137/80/1300732/user/1392549/htdocs/MYSITE/includes/classes/db/mysql/query_factory.php on line 120


    another error log:

    [08-Nov-2013 17:52:59 America/New_York] PHP Fatal error: 0: :: SELECT parent_id FROM categories WHERE categories_id = 103 in /data/14/1/137/80/1300732/user/1392549/htdocs/MYSITE/includes/classes/db/mysql/query_factory.php on line 120
    Last edited by twi; 11 Nov 2013 at 10:10 PM.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v154 Upgrade from 150 to 154 did not change passwords in DB to $2Y format
    By spyderrobotics in forum General Questions
    Replies: 6
    Last Post: 11 Jan 2016, 07:31 PM
  2. v154 Can't login to admin after database upgrade from 151 to 1.54.
    By SignaGen2 in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 26 Aug 2015, 06:54 PM
  3. v153 upgrade from 151 to153
    By rehopper in forum Basic Configuration
    Replies: 2
    Last Post: 2 Nov 2014, 02:52 PM
  4. Replies: 12
    Last Post: 17 Mar 2014, 11:10 PM
  5. cannot find source of problem (150=>151)
    By ajmn in forum General Questions
    Replies: 3
    Last Post: 15 Nov 2012, 11:33 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR