Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 2 votes

1064 - You have an error in your SQL syntax


355 replies to this topic

#341 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 14 May 2010, 19:03

View PostTracyS, on 14 May 2010, 14:23, said:

As for casting the product id to an integer - is that done by simply putting (int) in front of products_id so the query would have (int)products_id ?
Yep.

#342 292shadow

  • Community Member
  • 1 posts
  • Real Name:ben rees

Posted 27 May 2010, 09:32

Please Help

Hi im getting this error on the cataloge side of my website when i try to view the product details.

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 'from products p, products_description pd where p.products_status = '1' and p.pro' at line 1

select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_reviews_optional, from products p, products_description pd where p.products_status = '1' and p.products_id = '123' and pd.products_id = p.products_id and pd.language_id = '1'

[TEP STOP]



Thanks

#343 Patrick67

  • Community Member
  • 13 posts
  • Real Name:Patrick

Posted 29 May 2010, 02:05

I have started making a new site/design
somehow while making it I have broken my original site which was working fine
Im not sure how I did it but...


It started with the 1064 - syntax error
which I part-corrected with the original post's fix
however I now have

Warning: Division by zero in /home/hosscom/public_html/catalog/includes/classes/split_page_results.php on line 59
Displaying 0 to 0 (of 4 products) Result Pages: -4 -3 -2 -1 0

appearing at the top of product listing pages
and i cant navigate to following pages of that designer

if i simply remove line 59
i can see the whole list of products but it is wrong

any ideas?

regards
Patrick

see error at
http://www.hoss.com.au/catalog/index.php?cPath=61

#344 Patrick67

  • Community Member
  • 13 posts
  • Real Name:Patrick

Posted 29 May 2010, 02:42

ive had to delete line 59 just so I can display all products
but the site is messed up now

#345 germ

  • Community Member
  • 13,564 posts
  • Real Name:Jim
  • Gender:Male
  • Location:USA (GMT-6)

Posted 29 May 2010, 15:32

View PostPatrick67, on 29 May 2010, 02:42, said:

ive had to delete line 59 just so I can display all products
but the site is messed up now
Admin >> Configuration >> Maximum Values

On that page be sure 'Search Results' is greater than ZERO
If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

"Headers already sent" - The definitive help

"Cannot redeclare ..." - How to find/fix it

SSL Implementation Help

Like this post? "Like" it again over there >

#346 Patrick67

  • Community Member
  • 13 posts
  • Real Name:Patrick

Posted 30 May 2010, 08:00

ahh
thank you
I has set manufacturers to zero

#347 iLLuSiOnS

  • Community Member
  • 82 posts
  • Real Name:Sean

Posted 27 August 2010, 08:39

Hey People. Can someone help me out, I am in desperate need. After Moving my hosting to a new server, which I believe is running newer MySQL versions, I get this error only when I am trying to access the admin page

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 g.admin_groups_id=' at line 1

select a.admin_id, a.admin_firstname, a.admin_lastname, a.admin_email_address, a.admin_created, a.admin_modified, a.admin_logdate, a.admin_lognum, g.admin_groups_name from admin a, admin_groups g where a.admin_id= and g.admin_groups_id=

[TEP STOP]



Can someone Please help me out. Thank you so much.

#348 imcontreras

  • Community Member
  • 1 posts
  • Real Name:Antonio Contreras

Posted 24 January 2011, 23:29

and yes, after 6 years to been posted still helps. THANKS!! :rolleyes:

#349 cobratoys

  • Community Member
  • 35 posts
  • Real Name:Brad
  • Gender:Male

Posted 28 January 2011, 09:58

I have read, re-read this and many other posts and yet cannot get the problem fixed. my error only occurs when I try to duplicate a product from within the admin section, the error appears on the categories.php file

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.06', '0', '0', '12')' at line 1

insert into products (products_quantity, products_model, products_image, products_image_medium, products_image_large, products_price, products_cost, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('2', 'HW2009048', 'HW2009048.JPG', '', '', '4.9900', '0.0000', ' now(), '', '0.06', '0', '0', '12')

[TEP STOP]

I would be most grateful if anyone could shed some light on this. Thanks

Edited by cobratoys, 28 January 2011, 10:04.


#350 cobratoys

  • Community Member
  • 35 posts
  • Real Name:Brad
  • Gender:Male

Posted 28 January 2011, 11:44

Finally figured it out, I wqas missing a quotation mark after the now() statement.


............  ' now(), '', ............

should have been

............  ' now()', '', ............

Edited by cobratoys, 28 January 2011, 11:44.


#351 ivo_minchev

  • Community Member
  • 2 posts
  • Real Name:Ivo Minchev

Posted 28 January 2011, 21:57

I have the same error in my site.
I've added a Member_Approval_v1.6 form HERE. The error shows up when I click "Activate" at the admin side at Customers-Waiting Aproval-"Client name".

Database: MySQL 5.0.51a-log
HTTP Server: Apache/1.3.41 (Unix) PHP/4.4.8 mod_ssl/2.8.31 OpenSSL/0.9.8g
PHP Version: 4.4.8 (Zend: 1.3.0)

PLEASE HELP!

See the attached screenshots!

[img]http://cis-bg.net/catalog/capture1.jpg[/img]
[img]http://cis-bg.net/catalog/capture2.jpg[/img]

Edited by ivo_minchev, 28 January 2011, 22:02.


#352 danil0

  • Community Member
  • 72 posts
  • Real Name:Daniel
  • Gender:Male
  • Location:Greece Athens

Posted 20 February 2011, 18:15

thank you so much...!!! you are great I was looking for this solution so much thank thank thank you!

#353 reneesox

  • Community Member
  • 1 posts
  • Real Name:K Park

Posted 25 July 2011, 11:08

Mine already have the ' max($offset, 0) ' in the code .

I fixed it by adding the code below. I still need to monitor more but it works at the moment.

Try this and see whether it also works for you. Fingers cross. ;)

/admin/includes/classes/split_page_results.php


/* START */
if ($max_rows_per_page <= 0)
{
$max_rows_per_page=max($max_rows_per_page,12); // 12 can be changed to your prefered numbers per page

}
/* END*/

$num_pages = ceil($query_num_rows / $max_rows_per_page);
if ($current_page_number > $num_pages) {
$current_page_number = $num_pages;
}
$offset = ($max_rows_per_page * ($current_page_number - 1));
$sql_query .= " limit " . max($offset, 0) . ", " . $max_rows_per_page;
}

Edited by reneesox, 25 July 2011, 11:10.


#354 nixdorfnew

  • Community Member
  • 2 posts
  • Real Name:Nguyen Thanh

Posted 28 January 2012, 16:45

I have read many other posts but i cannot get the problem fixed. my error only appears when I click on a product, the error appears on the product_info.php. This error only appears since the time I updated from version 2.2 to version 2.31:


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 '= '203' and status = 1' at line 1

select specials_new_products_price from specialswhere products_id = '203' and status = 1

[TEP STOP]


Thank you for every hint or advices .

#355 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 28 January 2012, 17:07

There appears to be a space missing here: specialswhere

#356 nixdorfnew

  • Community Member
  • 2 posts
  • Real Name:Nguyen Thanh

Posted 29 January 2012, 07:17

View PostJan Zonjee, on 28 January 2012, 17:07, said:

There appears to be a space missing here: specialswhere

Thank you very much for your help.