Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error 1064 (I really need expert help.)


Guest

Recommended Posts

Hi, I've had this problem when switching to a new server where I can't edit manufacturers, I first had the problem with editing products the error was a lot like this one but after constant searching I found a post directing me to editing the split_page_results.php and replacing 3 lines of code. This fix was useful, the problem with editing and creating items was fixed. Now when I try and edit the models/manufacturers I get a similar error only I can't find a fix for it;

 

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 'mod WHERE man.manufacturers_id = mod.manufacturer_id AND mod.manufacturer_id='15' at line 1

 

SELECT mod.model_id,man.manufacturers_name,mod.name FROM manufacturers man,models mod WHERE man.manufacturers_id = mod.manufacturer_id AND mod.manufacturer_id='15';

 

[TEP STOP]

 

I have already edited both split_page_results.php in both classes folder in and out of admin. Now I don't know what else to edit, I have already applied the fix posted on about a hundred sites. The solution worked for my items but not for this manufacturers error.

 

This problem really has me stomped :angry:

Please reply back asap I need to get this finally fixed.

 

Thank you,

Ilan

Link to comment
Share on other sites

I just found the error on other pages:

 

Discount Coupons

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

 

-----------------------------------------------------------------------------------------------------------------

Best Viewed Products

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 p.products_id, pd.products_name, pd.products_viewed, l.name from products' at line 1

 

select count(select p.products_id, pd.products_name, pd.products_viewed, l.name from products p, products_description pd, languages l where p.products_id = pd.products_id and l.languages_id = pd.language_id order by pd.products_viewed DESC) as total

 

----------------------------------------------------------------------------------------------------------------

Best Viewed Products

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 p.products_id, pd.products_name, pd.products_viewed, l.name from products' at line 1

 

select count(select p.products_id, pd.products_name, pd.products_viewed, l.name from products p, products_description pd, languages l where p.products_id = pd.products_id and l.languages_id = pd.language_id order by pd.products_viewed DESC) as total

 

 

They are on a few more as well, all but Items, which I fixed the first time.

 

I don't know what's causing this.

Link to comment
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 'mod WHERE man.manufacturers_id = mod.manufacturer_id AND mod.manufacturer_id='15' at line 1

 

SELECT mod.model_id,man.manufacturers_name,mod.name FROM manufacturers man,models mod WHERE man.manufacturers_id = mod.manufacturer_id AND mod.manufacturer_id='15';

Perhaps a new MySQL version doesn't like the fact that in one table the manufacturer id is manufacturers_id and in the other manufacturer_id.

 

You might try (in phpMyAdmin):

SELECT mod.model_id,man.manufacturers_name mod.name FROM manufacturers man join models mod on man.manufacturers_id = mod.manufacturer_id where mod.manufacturer_id='15';

and if that works find the query in the code and change it.

Link to comment
Share on other sites

Perhaps a new MySQL version doesn't like the fact that in one table the manufacturer id is manufacturers_id and in the other manufacturer_id.

 

You might try (in phpMyAdmin):

SELECT mod.model_id,man.manufacturers_name mod.name FROM manufacturers man join models mod on man.manufacturers_id = mod.manufacturer_id where mod.manufacturer_id='15';

and if that works find the query in the code and change it.

 

Thanks for the reply, I have no clue where to go look at phpmyadmin, I can log into it fine but it looks like chinese to me I don't want to edit blindly in fear that I could mess up whatever is still working. Where do I edit the code exactly?

 

Thank you

Link to comment
Share on other sites

I have no clue where to go look at phpmyadmin, I can log into it fine but it looks like chinese to me I don't want to edit blindly in fear that I could mess up whatever is still working.
Using a select statement in a query like this doesn't change anything in your database. It selects records... Somewhere in phpMyAdmin there is a link to page where you can input SQL to be executed on your database in a text area. The documentation on phpMyAdmin can be found on their website.
Where do I edit the code exactly?
If you find that sql code is working then you can try to find it in your php code ("find" in your text editor and look for mod.model_id,man.manufacturers_name for example). Perhaps on the page where the error is showing, perhaps on a module that is "included". I don't have a crystal ball, so I can't tell you.
Link to comment
Share on other sites

The next day, still nothing. I am very concerned with being able to view my orders. I have no idea still how to go about fixing this..

 

Orders

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 o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last' at line 1

 

select count(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) as total

 

The error is different, but still no idea how to solve it. Anyone who can contribute to fixing this I appreciate it. My PHP skills are not exactly great.

 

Thank you,

Ilan

Link to comment
Share on other sites

Ok so I somehow managed to fix all the errors, all the errors but one, the manufacturers, the error keeps changing every few minutes it drives me nuts.

 

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 'mod WHERE man.manufacturers_id = mod.manufacturer_id AND mod.manufacturer_id='0'' at line 1

 

SELECT mod.model_id,man.manufacturers_name,mod.name FROM manufacturers man,models mod WHERE man.manufacturers_id = mod.manufacturer_id AND mod.manufacturer_id='0';

 

[TEP STOP]

 

No one has been able to help so far (as you've noticed reading this post lol) if a solution does come up please comment.

 

Thanks

Link to comment
Share on other sites

After searching still, the next day, I've found nothing so far. Has anyone encountered this problem? I edited split_page_results.php already (as the official fix said to do) I don't know how to go about fixing the manufacturers problem.

 

I really need this fixed.. Any help is appreciated.

Link to comment
Share on other sites

is there an single or double quote or an apostrophe in a manufacturers name? This will often exit the mysql query and often cause a friggin headache.

 

Nope, no single nor double quote. This problem is a friggin headache. I tried the official fix and it worked only on 5 out of the 6 pages affected. The 6th gives that damn error, and I still can't get it fixed. It's driving me crazy.. :'(

Link to comment
Share on other sites

Nope, no single nor double quote. This problem is a friggin headache. I tried the official fix and it worked only on 5 out of the 6 pages affected. The 6th gives that damn error, and I still can't get it fixed. It's driving me crazy.. :'(

 

I am having the very same error after deleting all the manufacturers as my store has nothing with a manufacturer. Apparently, osC doesn't like an empty manufacturers list as it comes up with the 1064 error even when you try to edit the man. list (I was going to try adding one back!). It shows up on the orders and various other pages as well--even after trying the posted fixes. Let me know if you find the bug! I'm still searching as well....

Link to comment
Share on other sites

it's been about a week, STILL no solution to my error. I can't add any models/manufacturers.. this is really bad. I really need this fixed..

 

I tried a few pay-for-coder sites to have an "expert" look at the problem and still nothing.

 

I'm beginning to feel hopeless here. If anyone knows how to fix it please help.

Link to comment
Share on other sites

it's been about a week, STILL no solution to my error. I can't add any models/manufacturers.. this is really bad. I really need this fixed..

 

I tried a few pay-for-coder sites to have an "expert" look at the problem and still nothing.

 

I'm beginning to feel hopeless here. If anyone knows how to fix it please help.

I'll have a look if you like and if you can grant me access to your site. Drop me a PM.

Link to comment
Share on other sites

  • 3 weeks later...

Archived

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

×
×
  • Create New...