snubbr.com

Y do I keep getting e-mail re: Verisign SSL when I do have it activated?

Get a Verisign SSL certificate for 30 days FREE. Click here to use coupon...

Get a free trial of Verisign SSL certificates. Click here for this special deal...
Got a question... Y do I keep getting e-mail re: Verisign SSL when I do have it activated? Thanks for any comment. Another quick question... Hey.

I have a problem with my catalog. When a client try to see his account history he they receive the follow 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 '-0, 0' at line 1.

Select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from orders o, orders_total ot, orders_status s where o.customers_id = '4' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '2' order by orders_id DESC limit -0, 0.

[TEP STOP].

I try to edit /includes/classes/split_page_results.php and change:.

$offset = ($max_rows_per_page * ($current_page_number - 1));.

$sql_query .= " limit "$offset", "$max_rows_per_page;.

To this:.

$offset = ($max_rows_per_page * ($current_page_number - 1));.

If ($offset < 0) { $offset = 0 ; }.

$sql_query .= " limit "$offset", "$max_rows_per_page;.

The error problem is resolve but it cause other like de link page became some like this -> -4, -3, -2, -1, 0.

And the in new produtos in first page became bad organized..

I have already made that update, but because I have made some change in my catalog design, I only update the following files:.

Catalog/admin/includes/classes/email.php.

Catalog/admin/includes/classes/split_page_results.php.

Catalog/admin/includes/classes/upload.php.

Catalog/admin/includes/functions/database.php.

Catalog/admin/includes/functions/general.php.

Catalog/admin/includes/functions/html_output.php.

Catalog/admin/categories.php.

Catalog/admin/file_manager.php.

Catalog/admin/orders.php.

Catalog/includes/classes/email.php.

Catalog/includes/classes/shopping_cart.php.

Catalog/includes/classes/split_page_results.php.

Catalog/includes/functions/database.php.

Catalog/includes/functions/general.php.

Catalog/includes/functions/html_output.php.

Catalog/includes/functions/sessions.php.

Catalog/address_book_process.php (051113).

Catalog/advanced_search_result.php.

Catalog/index.php.

Catalog/redirect.php.

And the error continues....

Someone can help me?.

Thanks..

Comments (106)

I would like to know the answer too. Anyone here know what is the right answer. I'll do some poking around and get back to you if I find an good answer. You should email the people at Verisign as they probably could assist you..

Comment #1

I had a similar problem recently but my error was 1054.

The cause of it after a bit of searching around seemed to be the newer versions of Mysql and PHP..

My live shop server uses Mysql 4 and PHP 4 whereas my offline test server uses PHP 4 and mysql 5.

So as more and more servers upgrade I think this problem will increase for many users..

Solution I used a contribution to replace some files which has done the trick for me and possibly do this for you..

Http://www.oscommerc...tributions,3727.

JCProgrammes..

Comment #2

I was also havin the same error and I added a line to.

Admin/includes/classes/split_page_results.php.

Just look for the added by me comment. This works for sure.

<?php.

/*.

$Id: split_page_results.php,v 1.13 2003/05/05 17:56:50 dgw_ Exp $.

OsCommerce, Open Source E-Commerce Solutions.

Http://www.oscommerce.com.

Copyright © 2002 osCommerce.

Released under the GNU General Public License.

*/.

Class splitPageResults {.

Function splitPageResults(&$current_page_number, $max_rows_per_page, &$sql_query, &$query_num_rows) {.

If (empty($current_page_number)) $current_page_number = 1;.

$pos_to = strlen($sql_query);.

$pos_from = strpos($sql_query, ' from', 0);.

$pos_group_by = strpos($sql_query, ' group by', $pos_from);.

If (($pos_group_by < $pos_to) && ($pos_group_by != false)) $pos_to = $pos_group_by;.

$pos_having = strpos($sql_query, ' having', $pos_from);.

If (($pos_having < $pos_to) && ($pos_having != false)) $pos_to = $pos_having;.

$pos_order_by = strpos($sql_query, ' order by', $pos_from);.

If (($pos_order_by < $pos_to) && ($pos_order_by != false)) $pos_to = $pos_order_by;.

$reviews_count_query = tep_db_query("select count(*) as total "substr($sql_query, $pos_from, ($pos_to - $pos_from)));.

$reviews_count = tep_db_fetch_array($reviews_count_query);.

$query_num_rows = $reviews_count['total'];.

$num_pages = ceil($query_num_rows / $max_rows_per_page);.

If ($current_page_number > $num_pages) {.

$current_page_number = $num_pages;.

}.

// XXX Added by Me **************************************************.

If($current_page_number == 0) { $current_page_number = 1; }.

// XXX ************************************************************.

$offset = ($max_rows_per_page * ($current_page_number - 1));.

$sql_query .= " limit "$offset", "$max_rows_per_page;.

}.

Function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page') {.

Global $PHP_SELF;.

If ( tep_not_null($parameters) && (substr($parameters, -1) != '&') ) $parameters .= '&';.

// calculate number of pages needing links.

$num_pages = ceil($query_numrows / $max_rows_per_page);.

$pages_array = array();.

For ($i=1; $i<=$num_pages; $i++) {.

$pages_array[] = array('id' => $i, 'text' => $i);.

}.

If ($num_pages > 1) {.

$display_links = tep_draw_form('pages', basename($PHP_SELF), '', 'get');.

If ($current_page_number > 1) {.

$display_links .= '<a href="'tep_href_link(basename($PHP_SELF), $parameters$page_name'='($current_page_number - 1), 'NONSSL')'" class="splitPageLink">'PREVNEXT_BUTTON_PREV'</a>&nbsp;&nbsp;';.

} else {.

$display_links .= PREVNEXT_BUTTON_PREV'&nbsp;&nbsp;';.

}.

$display_links .= sprintf(TEXT_RESULT_PAGE, tep_draw_pull_down_menu($page_name, $pages_array, $current_page_number, 'onChange="this.form.submit();"'), $num_pages);.

If (($current_page_number < $num_pages) && ($num_pages != 1)) {.

$display_links .= '&nbsp;&nbsp;<a href="'tep_href_link(basename($PHP_SELF), $parameters$page_name'='($current_page_number + 1), 'NONSSL')'" class="splitPageLink">'PREVNEXT_BUTTON_NEXT'</a>';.

} else {.

$display_links .= '&nbsp;&nbsp;'PREVNEXT_BUTTON_NEXT;.

}.

If ($parameters != '') {.

If (substr($parameters, -1) == '&') $parameters = substr($parameters, 0, -1);.

$pairs = explode('&', $parameters);.

While (list(, $pair) = each($pairs)) {.

List($key,$value) = explode('=', $pair);.

$display_links .= tep_draw_hidden_field(rawurldecode($key), rawurldecode($value));.

}.

}.

If (SID) $display_links .= tep_draw_hidden_field(tep_session_name(), tep_session_id());.

$display_links .= '</form>';.

} else {.

$display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);.

}.

Return $display_links;.

}.

Function display_count($query_numrows, $max_rows_per_page, $current_page_number, $text_output) {.

$to_num = ($max_rows_per_page * $current_page_number);.

If ($to_num > $query_numrows) $to_num = $query_numrows;.

$from_num = ($max_rows_per_page * ($current_page_number - 1));.

If ($to_num == 0) {.

$from_num = 0;.

} else {.

$from_num++;.

}.

Return sprintf($text_output, $from_num, $to_num, $query_numrows);.

}.

}.

?>.

If any one else has the same error and uses my fix please post it here wud be nice to know if it's helped someone else..

Comment #3

Thank you Rose you helped me with my issue:.

Http://forums.oscomm...howtopic=183802..

Comment #4

Hi,.

I encounter these problems too..

I looked at the contribution with all the replacement files but that doesn;t look like a pleasant solution since a complete reinstall is needed (based on the txt-file included in the package).

Is there another way to solve these issues once a shop is already running?.

Gr,.

Marcel..

Comment #5

Not sure hey.

I got mine working and it's looking good so I dont want to fiddle around too much I may try introducing some or other module or contribution but that i'll do with a nother fresh installation and not with my curent shop...

Comment #6

Hi Rose,.

Can you please explain how you solved the "1064-issue"?.

I like to solve this as well since there are to many areas in my shop that result in this error now..

Gr,.

Marcel..

Comment #7

I am having the same error and tried adding the code but I still get this 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 '-10, 10' at line 1.

Select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from orders o, orders_total ot, orders_status s where o.customers_id = '152' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '1' order by orders_id DESC limit -10, 10.

[TEP STOP].

ANY help would be greatly appreicated!.

Thanks,.

Mark..

Comment #8

Another possible solution to some of these problems is to check your values in the "Maximum Values" area of the Admin - Configuration panel..

I was getting a "divide by zero" error on the account_history page, and I checked the Configurations settings, and the Order History was set to 0. I changed it to 10, and that got rid of that error..

So if you are experiencing any of these errors, particularly a "divide by zero" error, try going to Admin > Configuration > Maximum values, and see if the value associated with the trouble you are having is set to 0. Try setting it to something else and see if that clears up the problem...

Comment #9

I found a solution!.

In catalog/shopping_cart.php.

In the lines containing:.

$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix.

From "TABLE_PRODUCTS_OPTIONS" popt, "TABLE_PRODUCTS_OPTIONS_VALUES" poval, "// Patch osc-060817TABLE_PRODUCTS_ATTRIBUTES" pa.

Where pa.products_id = '"(int)$products[$i]['id']"'.

And pa.options_id = '"(int)$option"'.

And pa.options_id = popt.products_options_id.

And pa.options_values_id = '"(int)$value"'// Patch osc-060817.

And pa.options_values_id = poval.products_options_values_id// Patch osc-060817.

And popt.language_id = '"(int)$languages_id"'.

And poval.language_id = '"(int)$languages_id"'"); // Patch osc-060817.

REMOVE the //patch osc-060817.

This is a Syntax error and makes the SQL statement corrupt!.

Works fine!..

Comment #10

Thank you so much, I had the same problem and your solution has fixed it. Was panicking for a bit..

Karen..

Comment #11

Hey.

I have a problem with my catalog. When a client try to see his account history he they receive the follow 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 '-0, 0' at line 1.

Select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from orders o, orders_total ot, orders_status s where o.customers_id = '4' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '2' order by orders_id DESC limit -0, 0.

[TEP STOP].

I try to edit /includes/classes/split_page_results.php and change:.

$offset = ($max_rows_per_page * ($current_page_number - 1));.

$sql_query .= " limit "$offset", "$max_rows_per_page;.

To this:.

$offset = ($max_rows_per_page * ($current_page_number - 1));.

If ($offset < 0) { $offset = 0 ; }.

$sql_query .= " limit "$offset", "$max_rows_per_page;.

The error problem is resolve but it cause other like de link page became some like this -> -4, -3, -2, -1, 0.

And the in new produtos in first page became bad organized..

I have already made that update, but because I have made some change in my catalog design, I only update the following files:.

Catalog/admin/includes/classes/email.php.

Catalog/admin/includes/classes/split_page_results.php.

Catalog/admin/includes/classes/upload.php.

Catalog/admin/includes/functions/database.php.

Catalog/admin/includes/functions/general.php.

Catalog/admin/includes/functions/html_output.php.

Catalog/admin/categories.php.

Catalog/admin/file_manager.php.

Catalog/admin/orders.php.

Catalog/includes/classes/email.php.

Catalog/includes/classes/shopping_cart.php.

Catalog/includes/classes/split_page_results.php.

Catalog/includes/functions/database.php.

Catalog/includes/functions/general.php.

Catalog/includes/functions/html_output.php.

Catalog/includes/functions/sessions.php.

Catalog/address_book_process.php (051113).

Catalog/advanced_search_result.php.

Catalog/index.php.

Catalog/redirect.php.

And the error continues....

Someone can help me?.

Thanks..

Comment #12

Did you figure out a solution to this? I am having the same error...

Comment #13


This question was taken from a support group/message board and re-posted here so others can learn from it.

 

Categories: Home | Diet & Weight Management | Vitamins & Supplements | Herbs & Cleansing |

Sexual Health | Medifast Support | Nutrisystem Support | Medifast Questions |

Web Hosting | Web Hosts | Website Hosting | Hosting |

Web Hosting | GoDaddy | Digital Cameras | Best WebHosts |

Web Hosting FAQ | Web Hosts FAQ | Hosting FAQ | Hosting Group |

Hosting Questions | Camera Tips | Best Cameras To Buy | Best Cameras This Year |

Camera Q-A | Digital Cameras Q-A | Camera Forum | Nov 2010 - Cameras |

Oct 2010 - Cameras | Oct 2010 - DSLRs | Oct 2010 - Camera Tips | Sep 2010 - Cameras |

Sep 2010 - DSLRS | Sep 2010 - Camera Tips | Aug 2010 - Cameras | Aug 2010 - DSLR Tips |

Aug 2010 - Camera Tips | July 2010 - Cameras | July 2010 - Nikon Cameras | July 2010 - Canon Cameras |

July 2010 - Pentax Cameras | Medifast Recipes | Medifast Recipes Tips | Medifast Recipes Strategies |

Medifast Recipes Experiences | Medifast Recipes Group | Medifast Recipes Forum | Medifast Support Strategies |

Medifast Support Experiences |

 

(C) Copyright 2010 All rights reserved.