Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 2 votes

1064 - You have an error in your SQL syntax


355 replies to this topic

#81 andresskl

  • Community Member
  • 4 posts
  • Real Name:Andres Skliarevsky
  • Location:Mar del Plata, Argentina

Posted 10 December 2005, 14:02

Hi! for me, problems were instantly solved apllying this solution.
Thank you, Charles!

Andrés.


View PostSimplyeasier, on Apr 1 2005, 06:10 AM, said:

To fix this

In admin/includes/classes find split_page_results.php and - BACK IT UP then find the lines

$offset = ($max_rows_per_page * ($current_page_number - 1));
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

change to

$offset = ($max_rows_per_page * ($current_page_number - 1));
if ($offset < 0)
{
$offset = 0 ;
}
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;


hth

Charles


#82 Friendly

  • Community Member
  • 1 posts
  • Real Name:Richard

Posted 15 December 2005, 21:14

View PostSimplyeasier, on Apr 1 2005, 04:10 AM, said:

NOTE - I have NOT asked you to change catalog/includes/classes/split_page_results.php - If you have a problem on the catalog side you may want to try the same change in that file - I did and it went wrong so the change to my catalog/includes/classes/split_page_results.php file is a little more elaborate and I will share that here if it becomes an issue - but for now it seems people will mostly have a problem with empty files on the admin side.

Charles, I have this problem in the catalog. could you please send your more complicated fixes at this point?

#83 notfarnow

  • Community Member
  • 2 posts
  • Real Name:Todd MacMillan

Posted 15 December 2005, 23:35

Simplyeasier IS THE MASTA! WOW! How the hell did you figure that out? I have know Idea how. That was amazing. Literally. I deleted the tax zones default of Florida (as the tutorial I was using recommended) and got that freaky ass error. I googled it and PRESTO! Thanks for saving me boatloads of stress O great wise one. Keep it up!!!!!

http://www.notfarnow.com

#84 daena76

  • Community Member
  • 19 posts
  • Real Name:Daena
  • Location:Wilmington, NC USA

Posted 28 December 2005, 16:42

HELP PLEASE! I am having this error and don't know what to do.


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 'order by pd.products_name' at line 1

select count(p.products_id) as total order by pd.products_name


#85 Kerstin

  • Community Member
  • 20 posts
  • Real Name:Kerstin
  • Gender:Female
  • Location:Devon

Posted 28 December 2005, 19:32

Hi there,

I tried the above but am still having the following error message: (after installation of contribution purchase without account)

Quote

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 'customers_id, select customers_name, customers_company, custome

customers_id, select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified, cc_start, cc_issue, cc_cvv from orders where orders_id = '29'

can anybody help me fixing it? Will send you a box of sweets :)

#86 chadi22

  • Community Member
  • 1 posts
  • Real Name:door

Posted 18 February 2006, 09:11

mySQL query error: SELECT * FROM ibf_skin_templates_cache WHERE template_set_id= AND template_group_name IN ('skin_global', 'skin_shoutbox')

SQL error: 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 'AND template_group_name IN ('skin_global', 'skin_shoutbox')' at
SQL error code:
Date: Saturday 18th of February 2006 03:08:38 AM

Apache version 1.3.34 (Unix)

PERL version 5.8.7

Path to PERL /usr/bin/perl

Path to sendmail /usr/sbin/sendmail

Installed Perl Modules Click to View

PHP version 4.4.1

MySQL version 4.0.25-standard-log

cPanel Build 10.8.1-STABLE 114

Theme cPanel X v2.5.0

plz help help help my site is going down plz guys !!

#87 xmedias

  • Community Member
  • 102 posts
  • Real Name:Martin Raymond
  • Location:Ontario, Canada

Posted 20 February 2006, 00:27

Hi guys, I really need help now...

I installed CCC 9.3, works fine exept for a small detail, when I click on the link in the shopping cart infobox after the creation of a build it sends me the following error.

[START CODE]


1064 - You have an error in your SQL syntax near '' at line 1

select p.products_id from products p, products_to_categories ptc where p.products_status = '1' and p.products_id = ptc.products_id and ptc.categories_id =

[TEP STOP]


[END CODE] Any ideas that could have me go in the right direction, also, I think this causes to not have the builds show in the pendings on the admin side...

Thanks to all
Martin Raymond
Xtreme Medias, Owner

#88 dvoris

  • Community Member
  • 3 posts
  • Real Name:Debi Voris

Posted 21 February 2006, 04:18

View PostSimplyeasier, on Apr 1 2005, 01:10 AM, said:

Hi

First off - this fix is actually already recorded in the contributions section and many thanks to those who recorded it - but I don't think it is a contribution - rather a tip - Secondly the same problem has arisen for 4 people in a few days and I dare say it will happen to more as hosts migrate their mySQL databases to version 4.1.xx -

Hence I post here :D

If you get an error whilst creating \ modifying your database such that thro admin you delete all entries on a particular table you will likely get this message

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

followed by something like

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

or

select banners_id, banners_title, banners_image, banners_group, status, expires_date, expires_impressions, date_status_change, date_scheduled, date_added from banners order by banners_title, banners_group limit -20, 20

depending on which table you have deleted all records from.

To fix this

In admin/includes/classes find split_page_results.php and - BACK IT UP then find the lines

$offset = ($max_rows_per_page * ($current_page_number - 1));
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

change to

$offset = ($max_rows_per_page * ($current_page_number - 1));
if ($offset < 0)
{
$offset = 0 ;
}
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;
MySQL 4.1.xx handles negatives correctly (by forcing an error) in the code above unlike earlier versions of MySQL.

:o NOTE - I have NOT asked you to change catalog/includes/classes/split_page_results.php - If you have a problem on the catalog side you may want to try the same change in that file - I did and it went wrong so the change to my catalog/includes/classes/split_page_results.php file is a little more elaborate and I will share that here if it becomes an issue - but for now it seems people will mostly have a problem with empty files on the admin side.

hth

Charles

Thanks Charles - I tried what you asked me to do, but I cannot edit the file at all. I was able to copy what you wrote, but not paste or cut. I did back up the original file.

I am not a programmer. All I did was to open the file and tried to modify it. Is there something else I am supposed to do? The file properties were set for read, write and execute.


Debi

#89 dvoris

  • Community Member
  • 3 posts
  • Real Name:Debi Voris

Posted 21 February 2006, 04:24

Charles:

I tried what you told me to do, but I cannot edit the file at all. I checked the properties of the file, and it is set for write, read and execute. I cannot cut, paste or type in the file. I did back the file up.

I am not a programmer. All I did was to open the file. Is there something else, I am supposed to do?

Debi :huh:

#90 dvoris

  • Community Member
  • 3 posts
  • Real Name:Debi Voris

Posted 21 February 2006, 19:13

Charles:

I cannot edit the file. It won't let me type in the file or paste into the file. Please help.

Debi

#91 eko

  • Community Member
  • 22 posts
  • Real Name:eko m

Posted 22 February 2006, 10:37

thank you so much for the help! :)

dvoris you must go into your ftp and copy it to your local PC then edit with wordpad the save and upload and overite the orignal! >_<

Edited by eko, 22 February 2006, 10:38.


#92 xmedias

  • Community Member
  • 102 posts
  • Real Name:Martin Raymond
  • Location:Ontario, Canada

Posted 02 March 2006, 02:32

1064 - You have an error in your SQL syntax near '' at line 1

select p.products_id from products p, products_to_categories ptc where p.products_status = '1' and p.products_id = ptc.products_id and ptc.categories_id =



Anybody has an idea!!!!
Martin Raymond
Xtreme Medias, Owner

#93 xmedias

  • Community Member
  • 102 posts
  • Real Name:Martin Raymond
  • Location:Ontario, Canada

Posted 02 March 2006, 02:44

Hi,
when i create a system with CCC 9.3 it goes to the cart, than when I press on the shopping cart box link it sends me a error message like so:

[code start]

1064 - You have an error in your SQL syntax near '' at line 1

select p.products_id from products p, products_to_categories ptc where p.products_status = '1' and p.products_id = ptc.products_id and ptc.categories_id =

[TEP STOP]

[code stop]

Any ideas before I submit my own revemped version of CCC.
Martin Raymond
Xtreme Medias, Owner

#94 Gidget

  • Community Member
  • 10 posts
  • Real Name:Gidget Clayton

Posted 03 March 2006, 20:31

Charles,

Thank you so much. This fix worked on the first try. I had 4 1064 errors and it fixed them all.

Again, Thank you for helping the less knowledgable users work through problems!

Gidget

#95 MoSqiToN

  • Community Member
  • 28 posts
  • Real Name:..
  • Location:Japan

Posted 10 March 2006, 03:28

It worked for me straight up from the initial posting by "Simplyeasier"
Thank you soo much.

It seemed that my hosting provider upgraded their SQL without notifying me and when I checked I had that dreaded "1064 - You have an error in your SQL syntax" error.

Everything works fine now.

#96 m_rodgers

  • Community Member
  • 12 posts
  • Real Name:Marisa Rodgers

Posted 12 March 2006, 07:50

So thankful for this posting! Fixed exactly what I was looking for!!!! Thanks!

#97 Artic

  • Community Member
  • 7 posts
  • Real Name:Dev

Posted 13 March 2006, 13:56

Hello,

I have a little problem with Shipping modules. If I install a shipping module in the admin panel, I received the following messages :

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 'True', 'False'), ', now())' at line 1

insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable FLAT Shipping', 'MODULE_SHIPPING_FLAT_STATUS', 'True', 'Do you want to offer FLAT rate shipping?', '6', '0', 'tep_cfg_select_option(array('True', 'False'), ', now())

[TEP STOP]

Any help?
Thanks...

#98 bobsi18

  • Community Member
  • 436 posts
  • Real Name:bobsi18
  • Gender:Female
  • Location:Melbourne, Australia

Posted 16 March 2006, 11:37

Hi guys, I've been reading through the post and have a smiliar problem... On my catalogue side of things (on the index.php page), I am getting the following error (instead of a list of products):

1064 - You have an error in your SQL syntax near '-_oscommerce' at line 1

show table status from domainname_com_au_-_oscommerce

[TEP STOP]

Please please please does anyone know what's happening?

Thanks, Barbara

Edited by bobsi18, 16 March 2006, 11:38.

Easy Populate*Purchase Without Account*2nd Manufacturer*Product Listing in Columns*Actual Attribute Price*Add Weight to Product Attribute*New Attributes Manager*Display Cart In Header*Ship In Cart*AusPost*AusBank*Credit Class & Gift Voucher*Specials on default*Extra Fields*Header Tags*Image Magic*Points Reward*Printer Friendly Product*Simple Search Box*Specials valid from*Select specials*STS plus*Xsell*Active Countries*Credit Card by Fax/Phone*Center Shop* Online/Offline*Product in cart alert*Ultimate SEO urls*Dynamic Site map (modified)*Google Site Feed*Froogle Site feed*Updated spiders.txt*Auto mysql backup*Admin Access 22A*Fancier Invoice & Packingslip v6.1

#99 n2advnture

  • Community Member
  • 144 posts
  • Real Name:Mark

Posted 17 March 2006, 12:57

View PostMechBun, on Sep 10 2005, 10:54 PM, said:

Hi, thanks for posting this, unfortunately it did not fix my problem. =(

Here is what I am getting on catalog/account_history.php

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 = '20' 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

I did just change my orders.php but I had to in order to get the Cash/Check orders to show up in my admin section again.

Help!

Here is my /includes/classes/split_page code

  $offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));
	 // begin make sure that $offset is not lower than 0
	 if ($offset < 0 ) {
	  $offset = 0;
	 }
	 // end make sure that $offset is not lower than 0
	 $this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

MECHBUN,
Did you ever get this working properly? I am having the EXACT same issue/error and can't get it resolved.

If no orders were made it appears fine. Once an order is placed I get the 1064 error in the "order history" page.

I added the code to the admin/includes/class/split...but not sure what to do now to get it totaly resolved.

What exactly did you do?

Thanks!
~Mark

#100 n2advnture

  • Community Member
  • 144 posts
  • Real Name:Mark

Posted 17 March 2006, 19:53

Ok, got everything working now. wheeeewww....

The only thing is now my customer "order history" has -4, -3, -2, -1, 0 results pages.

I KNOW I saw this when I was looking through the 10,000 threads today but can't find it now.

~M