Jump to content

Archived

This topic is now archived and is closed to further replies.

Simplyeasier

1064 - You have an error in your SQL syntax

Recommended Posts

hi there.. i have tried looking for the source code fromther very first page though i do not SEE the code in the split_page_results at all..

 

i am getting to error below after i deleted all my customer.. can anyone please assist with some info???

 

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

 

select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id order by c.customers_lastname, c.customers_firstname limit -6, 6

 

 

also i forgot to mention i am using MySQL ver 4.0.27-standard

Share this post


Link to post
Share on other sites

I wanted to say thank you for this post. After moving my customers from my old server to the new one, I experienced some problems with a few of the stores. It seems like all of the problems were upgrade issues. This fixed us right up and all seems to be working.

 

Thank you,

 

Kim

Share this post


Link to post
Share on other sites

any one know how to fix 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 ' backorders from orders where orders_id = '714'' at line 1

 

select customers_id, 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 from, backorders from orders where orders_id = '714'

 

[TEP STOP]

Share this post


Link to post
Share on other sites
any one know how to fix 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 ' backorders from orders where orders_id = '714'' at line 1

 

select customers_id, 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 from, backorders from orders where orders_id = '714'

 

[TEP STOP]

you should re-do the installation for the contribution you're using. You added the backorders column after the "from" along with a coma. It should show in this case:

last_modified, backorders from orders where orders_id = '714'

Share this post


Link to post
Share on other sites

Hi,

 

I've had a quick look through this thread and it seems to be the right place. I want to check before I go and start hacking away at the code.

 

It is a customer who is having this problem with two specific products when they go to add to cart. They are able to add to cart other products which I find odd. My site is selling items and these items have been sold before without a problem. I have tried it out on different computers and I am not getting this error when I try to add to cart so I'm not sure what is going on. Any help would be really appreciated.

 

It is as follows

 

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

at line 1

 

delete from customers_wishlist WHERE customers_id=60 AND products_id=

 

[TEP STOP]

 

Thanks

Share this post


Link to post
Share on other sites
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 'and p.manufacturers_id = m.manufacturers_id p.products_id = pc.products_id and p' at line 1

 

select count(*) as total from products p, products_description pd, products_to_categories pc, manufacturers m where p.products_id = pd.products_id and pd.language_id = '1' and and p.manufacturers_id = m.manufacturers_id p.products_id = pc.products_id and pc.categories_id = '28' and p.manufacturers_id = 10

 

[TEP STOP]

 

Contrib is Quick Price Updates(122)

 

The offending code seems to be this:

////  select categories
 if ($current_category_id == 0){
	  if($manufacturer){
		$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status,  p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.manufacturers_id = m.manufacturers_id and p.manufacturers_id = " . $manufacturer . " $sort_by ";
	  }else{
			$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and p.manufacturers_id = m.manufacturers_id and pd.language_id = '$languages_id' $sort_by ";
	}
 } else {											 <---- This else statement starts if catagory changes  <----
	 if($manufacturer){
		$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status,  p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and and p.manufacturers_id = m.manufacturers_id p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.manufacturers_id = " . $manufacturer . " $sort_by ";
	  }else{
			$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and and p.manufacturers_id = m.manufacturers_id p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by ";
	}
 }

 

Problem comes in when changing the category, I have marked the else statement where that function starts, but can't figure out what the problem is....

 

Would greatly appreciate it if one of you PHP genies can figure this out! Thanks in advance!!


Riaan

Share this post


Link to post
Share on other sites
Contrib is Quick Price Updates(122)

 

The offending code seems to be this:

////  select categories
 if ($current_category_id == 0){
	  if($manufacturer){
		$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status,  p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.manufacturers_id = m.manufacturers_id and p.manufacturers_id = " . $manufacturer . " $sort_by ";
	  }else{
			$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and p.manufacturers_id = m.manufacturers_id and pd.language_id = '$languages_id' $sort_by ";
	}
 } else {											 <---- This else statement starts if catagory changes  <----
	 if($manufacturer){
		$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status,  p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and and p.manufacturers_id = m.manufacturers_id p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.manufacturers_id = " . $manufacturer . " $sort_by ";
	  }else{
			$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and and p.manufacturers_id = m.manufacturers_id p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by ";
	}
 }

 

Problem comes in when changing the category, I have marked the else statement where that function starts, but can't figure out what the problem is....

 

Would greatly appreciate it if one of you PHP genies can figure this out! Thanks in advance!!

 

Hi, my problem is not what I stated after investigating further. When you click on an item and view the product and click add to cart everything works OK. It's when I click the buy now button when multiple products are displayed. The definitely used to work but I cannot remember when was the last time I checked.

 

So I can add to cart if I'm in a specific item but if it's a list of items and I click the buy now button which should take me into the item to buy I get the error stated before.

 

Any ideas?

 

Thanks in advance

Share this post


Link to post
Share on other sites

Hey DAG.... :D

 

Sorry mate, wasn't replying to your problem, I was posting my own... Sorry about that....

 

Anyone out there that can help either of us?


Riaan

Share this post


Link to post
Share on other sites
Contrib is Quick Price Updates(122)

 

The offending code seems to be this:

////  select categories
 if ($current_category_id == 0){
	  if($manufacturer){
		$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status,  p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.manufacturers_id = m.manufacturers_id and p.manufacturers_id = " . $manufacturer . " $sort_by ";
	  }else{
			$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and p.manufacturers_id = m.manufacturers_id and pd.language_id = '$languages_id' $sort_by ";
	}
 } else {											 <---- This else statement starts if catagory changes  <----
	 if($manufacturer){
		$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status,  p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and and p.manufacturers_id = m.manufacturers_id p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.manufacturers_id = " . $manufacturer . " $sort_by ";
	  }else{
			$products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and pd.language_id = '$languages_id' and and p.manufacturers_id = m.manufacturers_id p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by ";
	}
 }

 

Problem comes in when changing the category, I have marked the else statement where that function starts, but can't figure out what the problem is....

 

Would greatly appreciate it if one of you PHP genies can figure this out! Thanks in advance!!

 

Guys, this one has been solved by the coder himself, new files uploaded to the contrib!


Riaan

Share this post


Link to post
Share on other sites

i tryed the fix and it stopped reporting the 1064 error but now i cant see the pending orders ( says 0 of 0 :s ) and everytime i change anything (configs, products, etc) it gives me another error (still it changes whatever i'm trying to do) being so:

 

Warning: Cannot modify header information - headers already sent by 
(output started at /home/ninhodos/public_html/loja/admin/includes/classes/split_page_results.php:4) 
in /home/ninhodos/public_html/loja/admin/includes/functions/general.php on line 18

 

help please :s

Share this post


Link to post
Share on other sites

Hello all,

 

I have searched through the thread to attempt to find some help regarding my situation but I am unable to find anything. I am attempting to add a new coupon with the Discount Coupons contribution but I am getting this error. I changed the coding as mentioned in the beginning but it still errors out. This is what I am seeing:

 

 

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 discount_coupons cd order by cd.coupons_date_end, coupons_date_sta' at line 1

select count(select * from discount_coupons cd order by cd.coupons_date_end, coupons_date_start) as total 

[TEP STOP]

 

Any help would be greatly appreciated. I am under a time crunch of sorts.

 

 

EDIT: I have now noticed when I go to look at my customers I am now receiving 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 'select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_' at line 1

select count(select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from customers c left join address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id order by c.customers_lastname, c.customers_firstname) as total 

[TEP STOP]

 

 

 

 

 

 

Again, any help would be greatly appreciated. I am somewhat new at OSC, so I don't know how to troubleshoot everything.

Share this post


Link to post
Share on other sites
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;

 

 

WORKS LIKE A CHARM NOW!!!! thanks

Share this post


Link to post
Share on other sites

Ok I am having this problem on the catalog side.

 

I applied the bug fix from http://www.oscommerce.com/community/bugs,1605

on my admin/includes/classes/split_page_results.php

the admin works great

 

and on /includes/classes/split_page_results.php

 

i use this fix

	 $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;

 

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

select p.products_id, pd.products_name, pd.products_info, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from products p, products_description pd, specials s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '4' and s.status = '1' order by s.specials_date_added DESC limit 0, MAX_DISPLAY_SPECIAL_PRODUCTS_LIST

[TEP STOP]

 

 

 

please help if you can.

Share this post


Link to post
Share on other sites

hi i have just installed this contrib and i am getting this error in admin>catalog>discount coupons

 

 

HEADING_TITLE NOTICE: HEADING_TITLE_VIEW_MANUAL

TEXT_DISCOUNT_COUPONS_ID TEXT_INFO_DISCOUNT_AMOUNT TEXT_INFO_DATE_START TEXT_INFO_DATE_END TEXT_INFO_MAX_USE TEXT_INFO_MIN_ORDER TEXT_INFO_NUMBER_AVAILABLE

parakeet ( 5% off your first purchase ) 5% 10/05/2007 01/06/2007 1000 TEXT_DISPLAY_UNLIMITED TEXT_DISPLAY_UNLIMITED

Page 1 of 1

IMAGE_NEW_COUPON

 

parakeet

Edit Delete IMAGE_PRODUCT_EXCLUSIONS IMAGE_MANUFACTURER_EXCLUSIONS IMAGE_CATEGORY_EXCLUSIONS IMAGE_CUSTOMER_EXCLUSIONS IMAGE_SHIPPING_ZONE_EXCLUSIONS

 

TEXT_INFO_DISCOUNT_AMOUNT 5%

TEXT_INFO_DATE_START 10/05/2007

TEXT_INFO_DATE_END 01/06/2007

TEXT_INFO_MAX_USE 1000

TEXT_INFO_MIN_ORDER TEXT_DISPLAY_UNLIMITED

TEXT_INFO_NUMBER_AVAILABLE TEXT_DISPLAY_UNLIMITED

 

 

Also when i add the discount code in the main site it doesn't discount 5% or any amount it just goes to the payment page.

 

Any ideas?

 

Thanks

 

andy

Share this post


Link to post
Share on other sites

THIS ONE FINALLY WORKED!! All the other ones did not for me

 

Found the following text in teh BUG list, it is posted by HPDL.

Basically the same fix as post #1 but more compact:

 

This fix was the life saver I needed, Thanks SOO MUCH.

Share this post


Link to post
Share on other sites
THIS ONE FINALLY WORKED!! All the other ones did not for me

This fix was the life saver I needed, Thanks SOO MUCH.

Share this post


Link to post
Share on other sites

HELP!!!!!!!!!

 

I am getting the same 1064 Error when I try to access the specials or review on the admin side.

 

I have tried every single fix here and it still gives me the same error.

 

any suggestions?

Share this post


Link to post
Share on other sites

Hi when i want to maken a new discoutn code I get the following error

 

1136 - Column count doesn't match value count at row 1

 

insert into discount_coupons values ( 'WCLB80', 'test', '10', 'fixed', null, null, 1, 10, 'price', 1)

 

[TEP STOP]

 

 

does anyone know how to fix this

 

thanks

Share this post


Link to post
Share on other sites
HELP!!!!!!!!!

 

I am getting the same 1064 Error when I try to access the specials or review on the admin side.

 

I have tried every single fix here and it still gives me the same error.

 

any suggestions?

 

 

i got same problemmmm plz help me ..... guys its ver yimp for me

Share this post


Link to post
Share on other sites
i got same problemmmm plz help me ..... guys its ver yimp for me

i have fis the solution by simply replacing admin/includes/classes/split_page_results.php by oscomemr 2.2 latest reasle file split_page_results.php ..

 

 

it works now .. is this ok? i have done ok? i got htis error due to template which ocems is osc... and i instaleld it... hoppe i have done ok if i didnt plz reply here

Share this post


Link to post
Share on other sites
i have fis the solution by simply replacing admin/includes/classes/split_page_results.php by oscomemr 2.2 latest reasle file split_page_results.php ..

it works now .. is this ok? i have done ok? i got htis error due to template which ocems is osc... and i instaleld it... hoppe i have done ok if i didnt plz reply here

 

guys i want to fix it when i click review in admin area it gives me error help

Share this post


Link to post
Share on other sites
guys i want to fix it when i click review in admin area it gives me error help

Why not following the manual instructions to upgrade your store with the latest version? Are you selectively applying one fix at a time?

Share this post


Link to post
Share on other sites

×