Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 2 votes

1064 - You have an error in your SQL syntax


355 replies to this topic

#21 Simplyeasier

  • Community Member
  • 966 posts
  • Real Name:Charles Kangethe
  • Location:Suffolk, England

Posted 31 May 2005, 08:42

christy, on May 31 2005, 06:44 AM, said:

Ok, I tried that, but it didn't work.

I got the dreaded 1064 error when I deleted all of the manufacturers. Oops!  :blink: How do I add manufacturers now?

So I am in the admin section trying to edit the manufacturers.

"Manufacturers 

Manufacturers Action 
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 '-20, 20' at line 1

select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from manufacturers order by manufacturers_name limit -20, 20

[TEP STOP]  "

Heeellp! :'(

<{POST_SNAPBACK}>


Are you running mysql 4.1.xx ? Have you changed the correct file in EXACTLY the way described ?

This has worked for the others - should work for you if the answers to the 2 questions are yes :D

Charles
A kite flies highest AGAINST the wind !

"Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, a lover in one hand, martini in the other, body thoroughly used up, totally worn out and screaming ~ WOO HOO!! What a ride!"

#22 christy

  • Community Member
  • 18 posts
  • Real Name:Christy

Posted 31 May 2005, 23:08

Simplyeasier, on May 31 2005, 01:42 AM, said:

Are you running mysql 4.1.xx ? Have you changed the correct file in EXACTLY the way described ?

This has worked for the others - should work for you if the answers to the 2 questions are yes  :D

Charles

<{POST_SNAPBACK}>


I figured it out. I went to my host, Dreamhost, and entered a value from there. They have a nice MySQL interface :)

Thanks,
Christy

#23 basalt

  • Community Member
  • 10 posts
  • Real Name:Basalt

Posted 07 June 2005, 07:13

Please HELP

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 ' products_id from orders_products where orders_id = '70'' at li

select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from, products_id from orders_products where orders_id = '70'

[TEP STOP]


Thx,
Basalt

#24 Techbot

  • Community Member
  • 45 posts
  • Real Name:Danny

Posted 07 June 2005, 17:09

I'm still on MySQL 3.23 ... and getting this error. is there a workaround for this?

#25 Mibble

  • Community Member
  • 13,404 posts
  • Real Name:JAO
  • Location:MA (US): 42n22, 71w04, Massachusetts

Posted 07 June 2005, 17:14

what error are you getting techbot?

#26 Mibble

  • Community Member
  • 13,404 posts
  • Real Name:JAO
  • Location:MA (US): 42n22, 71w04, Massachusetts

Posted 07 June 2005, 17:16

this is where your problem is

final_price from, products_id from orders_products


basalt, on Jun 7 2005, 02:13 AM, said:

Please HELP

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 ' products_id from orders_products where orders_id = '70'' at li

select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from, products_id from orders_products where orders_id = '70'

[TEP STOP]
Thx,
Basalt

<{POST_SNAPBACK}>



#27 Techbot

  • Community Member
  • 45 posts
  • Real Name:Danny

Posted 07 June 2005, 18:51

i'm not a coder :( i don't see what you're talking about. is it missing something?

#28 basalt

  • Community Member
  • 10 posts
  • Real Name:Basalt

Posted 07 June 2005, 22:55

Hello,
I use Mysql 4.0.22 & PayPal_Shopping_Cart_IPN_v3.1.5
And I have this error message when I open the invoice or edit the order in the admin part I believe that it is necessary to publish the file order.php

Then there is probably a problem of compatibility with mysql 4.0.22

thanks,
Basalt

Edited by basalt, 07 June 2005, 23:00.


#29 basalt

  • Community Member
  • 10 posts
  • Real Name:Basalt

Posted 08 June 2005, 18:28

It's all right

Find:
$orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity,products_id from final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");

Replace with:
$orders_products_query = tep_db_query("select orders_products_id, products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");

Thanks for all
Basalt

#30 rootuser

  • Community Member
  • 2 posts
  • Real Name:binus

Posted 21 June 2005, 05:20

:'( :'( Tried your bug fixes but the error is repeating

Manufacturers

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 '-20, 20' at line 1

select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from manufacturers order by manufacturers_name limit -20, 20

Reviews

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 '-20, 20' at line 1

select reviews_id, products_id, date_added, last_modified, reviews_rating from reviews order by date_added DESC limit -20, 20


Specials

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 '-20, 20' at line 1

select p.products_id, pd.products_name, p.products_price, s.specials_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = s.products_id order by pd.products_name limit -20, 20

Products Expected

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 '-20, 20' at line 1

select pd.products_id, pd.products_name, p.products_date_available from products_description pd, products p where p.products_id = pd.products_id and p.products_date_available != '' and pd.language_id = '1' order by p.products_date_available DESC limit -20, 20

Iam using

MySQL-client-4.1.11-0
MySQL-server-4.1.11-0

Please help me

#31 rootuser

  • Community Member
  • 2 posts
  • Real Name:binus

Posted 21 June 2005, 05:41

I fixed it thanks!

The fix for this is:

Edit these two files:
admin/includes/classes/split_page_results.php
/includes/classes/split_page_results.php

Insert:

if ($offset < 0)
{
$offset = 0 ;
}

Just before this line:
$this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

#32 scrap32

  • Community Member
  • 72 posts
  • Real Name:Sachie

Posted 22 June 2005, 12:16

I too, had this problem and tried your fix and it WORKED!!! Thank you so much :D :D

#33 Simplyeasier

  • Community Member
  • 966 posts
  • Real Name:Charles Kangethe
  • Location:Suffolk, England

Posted 22 June 2005, 12:34

rootuser, on Jun 21 2005, 06:41 AM, said:

I fixed it thanks!

The fix for this is:

Edit these two files:
admin/includes/classes/split_page_results.php
/includes/classes/split_page_results.php

Insert:

if ($offset < 0)
{
$offset = 0 ;
}

Just before this line:
$this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

<{POST_SNAPBACK}>


is this a joke ? - did you read the very first post in this thread - or are you into re-inventing the wheel ?

Charles
A kite flies highest AGAINST the wind !

"Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, a lover in one hand, martini in the other, body thoroughly used up, totally worn out and screaming ~ WOO HOO!! What a ride!"

#34 duntuk

  • Community Member
  • 4 posts
  • Real Name:duntuk

Posted 23 June 2005, 20:45

LOL

#35 Lao

  • Community Member
  • 173 posts
  • Real Name:Lao Mayer
  • Location:Bucharest, ROMANIA

Posted 26 June 2005, 03:50

Worked for me too,SimplyEasier. Thanks. ;)
Sorry for my bad english language!

#36 cdamianou

  • Community Member
  • 239 posts
  • Real Name:Costas

Posted 28 July 2005, 08:13

Hiya

Can someone please help me.

I tried the steps above and i cant seem to solve the problem.

I deleted all manufacturers from admin, and got the following 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 '-20, 20' at line 1

select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from manufacturers order by manufacturers_name limit -20, 20

The same error is everywere were their is nothing.

Please can someone help.

#37 OceanRanch

  • Community Member
  • 2,462 posts
  • Real Name:Tom
  • Location:Laguna, CA *USA*

Posted 28 July 2005, 20:15

You'll need to make approximately the same change in the catalog/admin/includes/split_page_results.php. The line numbers are a bit different but the net result is the same. Search in the bug report section for the exact line number if you need to.

HTH
Tom

#38 enigmaverse

  • Community Member
  • 10 posts
  • Real Name:Joe

Posted 01 August 2005, 21:07

tried this fix with no luck but my problem is slightly different. my error message is:

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 'MAX_ROW_LISTS_OPTIONS' at line 1

select * from products_options where language_id = '1' order by products_options_id LIMIT 0, MAX_ROW_LISTS_OPTIONS

[TEP STOP]

I'm running MySQL 4.1.9 with PHP 4.3.11 this is a completely fresh install, no info added, no mods, nothing... just uploaded the files and ran the install. After install I applied the mod in the first post and reposted. I think my problem is more related to a problem in the language files, but I dont know php enough to know whats wrong... I get numerous other error including failure to load certain includes in the footer of the catalog (starting with the language include) and the define labels instead of actual titles(HEADING_TITLE )... no idea how to fix, running in circles at this point. and cant continue without getting at least a smaple cart up and running...

#39 brzell

  • Community Member
  • 2 posts
  • Real Name:Bruce

Posted 10 August 2005, 21:46

I am now getting this error on the live side of the cart when you click on the Reviews button under a choosen product.

Any ideas ?

Warning: Division by zero in /home/enrich/public_html/shop/includes/classes/split_page_results.php on line 59

Thanks

#40 toby_uk

  • Community Member
  • 32 posts
  • Real Name:Toby

Posted 11 August 2005, 16:01

Hi,

I am just setting up my first OS Commerce project and am experiencing a slight variation on the problem in this thread.

The following error is displayed when I click on 'Orders' in the admin section:

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 '-20, 20' at line 1

select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by o.orders_id DESC limit -20, 20


[TEP STOP]

Is anyone available to offer help as to what the problem is?

Many thanks to anyone that can help :)