Forums / Templates, Stylesheets, Page Layout / WARNING: An Error occurred, please refresh the page and try again

WARNING: An Error occurred, please refresh the page and try again

Views: 12,555

Results 1 to 11 of 11
10 Jul 2016, 12:42 PM
#1
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

WARNING: An Error occurred, please refresh the page and try again

Bare with me still new and learning. Myfeatured products and all products page load with error have tried the troubleshooting to no avail was wondering if someone can point me where to go to fix
http://www.thedragonskeep.net/index.php?main_page=featured_products

http://www.thedragonskeep.net/index.php?main_page=products_all

Thanks
Sandria

10 Jul 2016, 7:46 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: WARNING: An Error occurred, please refresh the page and try again

.
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.

20 Jul 2016, 5:02 PM
#3
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again

[20-Jul-2016 09:27:58 America/Denver] 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 'limit 10' at line 1 :: limit 10 ==> (as called by) /home1/thedrah1/public_html/includes/templates/template_default/templates/tpl_modules_products_featured_listing.php on line 23 <== in /home1/thedrah1/public_html/includes/classes/db/mysql/query_factory.php on line 155

20 Jul 2016, 6:34 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: WARNING: An Error occurred, please refresh the page and try again

I suspect that the /includes/modules/pages/featured_products/header_php.php file is damaged, or you have multiple header_php.* files in that folder.

.
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.

31 Jul 2016, 1:57 PM
#5
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again

Thanks

So, I only have one header_php in featured products here it is do you see any errors I really appreciate your help really want to learn to do this myself. :-)

<?php
/**Single Listing Template mod v1.8
 * Featured Products header_php.php
 *
 * @package page
 * @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: header_php.php 6912 2007-09-02 02:23:45Z drbyte $
 */
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
$breadcrumb->add(NAVBAR_TITLE);
// display order dropdown
$disp_order_default = PRODUCT_FEATURED_LIST_SORT_DEFAULT;

require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_LISTING_DISPLAY_ORDER));

$featured_products_array = array();

$listing_sql = "SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call,
                                  p.product_is_always_free_shipping, p.products_qty_box_status,
                                  p.master_categories_id, m.manufacturers_id
                                  FROM (" . TABLE_PRODUCTS . " p
                                  LEFT JOIN " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " .
TABLE_PRODUCTS_DESCRIPTION . " pd
                                  LEFT JOIN " . TABLE_FEATURED . " f on pd.products_id = f.products_id )
                                  WHERE p.products_status = 1 and p.products_id = f.products_id and f.status = 1
                                  AND p.products_id = pd.products_id and pd.language_id = :languagesID " .
$order_by;

$listing_sql = $db->bindVars($listing_sql, ':languagesID', $_SESSION['languages_id'], 'integer');
$featured_products_split = new splitPageResults($featured_products_query_raw, MAX_DISPLAY_PRODUCTS_FEATURED_PRODUCTS);

//check to see if we are in normal mode ... not showcase, not maintenance, etc
  $show_submit = zen_run_normal();

$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
  'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
  'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
  'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
  'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
  'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
  'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);

  /*                         ,
  'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
  */
  asort($define_list);
  reset($define_list);
  $column_list = array();
  foreach ($define_list as $key => $value)
  {
    if ($value > 0) $column_list[] = $key;
  }
?>
31 Jul 2016, 5:45 PM
#6
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,872
Plugin Contributions:
19

Re: WARNING: An Error occurred, please refresh the page and try again

Again, it really would help if you would answer the posting tips. You are using a mod for version 1.3.9 but don't say your version of ZC. A lot of changes have been made since 1.3.9

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

31 Jul 2016, 6:09 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: WARNING: An Error occurred, please refresh the page and try again

Amethyst_fairy:

<?php /**Single Listing Template mod v1.8 * Featured Products header_php.php ``` That's not how the original Zen Cart file begins, so clearly it's been altered. Whoever rewrote this file broke it: Note the use of $listing_sql vs $featured_products_split in the code you quoted: > **Amethyst\_fairy:** > > ``` $listing_sql = "SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id, m.manufacturers_id FROM (" . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd LEFT JOIN " . TABLE_FEATURED . " f on pd.products_id = f.products_id ) WHERE p.products_status = 1 and p.products_id = f.products_id and f.status = 1 AND p.products_id = pd.products_id and pd.language_id = :languagesID " . $order_by; $[B]listing_sql[/B] = $db->bindVars($listing_sql, ':languagesID', $_SESSION['languages_id'], 'integer'); $featured_products_split = new splitPageResults($[B]featured_products_query_raw[/B], MAX_DISPLAY_PRODUCTS_FEATURED_PRODUCTS); ``` Now note what the template file is expecting: > **Amethyst\_fairy:** > > [20-Jul-2016 09:27:58 America/Denver] PHP Fatal error: 1064:You have an error in your SQL syntax; > ... /includes/templates/template_default/templates/**tpl_modules_products_featured_listing.php** on line 23 <== in ``` 22 if ($featured_products_split->number_of_rows > 0) {23 $featured_products = $db->Execute($featured_products_split->sql_query); ``` In the header file, $listing_sql contains the query And $featured_products_split is set to $featured_products_query_raw instead of to $listing_sql ... so instead of generating a complete query all it does is respond to the "limit" syntax for limiting the maximum number of records to display (ie: "limit 10" in your case, as reported in your error log). So when the template tries to access $featured_products_split, it gets a broken query, and of course no results. Solution: put back the original header_php.php file until you sort out why it had been changed in the first place and obtain/create a proper working version of the customizations you're using ... if you really even need them at all. Most people don't need the change anyway.

.
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.

31 Jul 2016, 7:20 PM
#8
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again

Sorry so I am using zencart 1.54 and the template is stirling grand. My guess is was probably installed wrong with the orginal installation. I will try putting in the original downloading original files now. I made mistake when we first started site to pay someone to install our store so now learning what has been installed or not. Planning to eventually work on updating to 1.55 Thanks so much for you help.

31 Jul 2016, 7:29 PM
#9
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again

OMG thank you so much I download zencart 1.54 transferred using filezilla and bingo it works. Thank you so much for helping me fix it. Website is running so much faster too.
Thanks
Sandria

31 Jul 2016, 10:32 PM
#10
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: WARNING: An Error occurred, please refresh the page and try again

/**Single Listing Template

If you find that comment lurking in your files somewhere I recommend you plan to get rid of it on your next upgrade.

While I made that mod with the best of intentions, it was a very long time ago when I knew even less than I do now, and involves a world of merging/upgrading pain. I long ago stopped trying to support it, it was such a pig and should not be in a site past 1.39.

I have literally just spent today removing what I hope are the last traces of it for my own 155 upgrade.
Not that it was broken at all, it was just a lot of non-standard code I wanted out of the way before going responsive.

It is quicker to just just mod each of the three templates into the same way you want them.

(The devs are improving things and the pages will all have a common structure in 1.6 anyway.)

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

1 Aug 2016, 1:45 AM
#11
amethyst_fairy avatar

amethyst_fairy

Zen Follower

Join Date:
Feb 2016
Location:
Salem, NH
Posts:
103
Plugin Contributions:
0

Re: WARNING: An Error occurred, please refresh the page and try again

Thank you will keep my eye out as I transition. Whenever I have time for that project lol. :-)