Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

easy Populate : error MySql 1064


ralgiere

Recommended Posts

Could someone PLEASE, PLEASE help me I have been trying to get Easy Populate to work for months. I have done a lot of reading and I am doing something wrong most of the time it times out or I am getting 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 '' at line 1

select vendors_name from vendors where vendors_id = 

[TEP STOP]

I included a Screenshot:

test-CSV7-28-19.csvtest-CSV7-28-19.csv

 

 

1556277837_EasyPopulate.JPG.c5754c49594ef563337ece3a93c757d7.JPG

Edited by bonbec
Title change and critical information removed for security reason
Link to comment
Share on other sites

Link to comment
Share on other sites

Can you please post the code snippet with the sql query you seems to have modified and added vendors_name....

Then we can have a look on the syntax and try to find what's wrong.

Please take also in consideration these recomendations:

 

Link to comment
Share on other sites

Sorry It is very obvious I am not a developer or a programer and I haven't a clue of what I am doing.Could you please tell me where I can find the code snippet with the sql query you are referring to?

Link to comment
Share on other sites

First of all, if you didn't modify the code, which exact easy populate version are you using? Downoald link?

The standard version which I know does not include support for vendors. And are you using an addon called something like "vendors"?

Link to comment
Share on other sites

Thank you for helping me. Please direct me to do what needs to be done. I will do what is necessary to get this working. I think 1.0 beta

Edited by ralgiere
Link to comment
Share on other sites

31 minutes ago, ralgiere said:

I had a friend that downloaded and modified the code. I am also using MVS.May be he added the Vendors

Then you should ask your friend for help. We can't give help on code which is not standard and which has been modified to fit customized stores.

Otherwise you can post in the commercial support section to find a developer to fix this for you.

If you wants to give it a try, please open the file admin/easy populate, search for lines which contain " vendors_name" and post here the lines with this code. Include some lines before and after. We'll see if it's an easy fix.

Link to comment
Share on other sites

// find the vendor id from the name imported
                if (EP_MVS_SUPPORT == true) {
                  $vend_result = tep_db_query("SELECT vendors_id FROM ".TABLE_VENDORS." WHERE vendors_name = '". $v_vendor . "'");
                  $vend_row = tep_db_fetch_array($vend_result);
                  $v_vendor_id = $vend_row['vendors_id'];
                }
                
 if (EP_MVS_SUPPORT == true) {
                  $result2 = tep_db_query("select vendors_name from ".TABLE_VENDORS." WHERE vendors_id = " . $row['v_vendor_id']);
                  $row2 =  tep_db_fetch_array($result2);        
                  $row['v_vendor'] = $row2['vendors_name'];
                }

/*                if (MASTER_PRODUCTS_SUPPORT == true) {
                  $result2 = tep_db_query("select products_master from ".TABLE_PRODUCTS." WHERE products_id = " . $row['v_products_id']);
                  $row2 =  tep_db_fetch_array($result2);
                  $row['v_products_master'] = $row2['vendors_name'];
                }                

Link to comment
Share on other sites

Try this in the first snippet you posted:

                  $vend_result = tep_db_query("SELECT vendors_id FROM ".TABLE_VENDORS." WHERE vendors_name = ". $v_vendor);

 

Link to comment
Share on other sites

I am still getting this error:

When I click on Download Model/Price/Qty .csv file to edit in the Create then Download Files  in Quick Links. I receive 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 '' at line 1

select vendors_name from vendors where vendors_id = 

[TEP STOP]

Edited by ralgiere
Link to comment
Share on other sites

Probably the variable $v_vendor is not defined. Then please ask your friend for help or post in the commercial support thread. I believe it is not possible to help here. You could also try in the official support thread, maybe someone who is also using the vendo addon can help. I never used it and can't test.

https://www.oscommerce.com/forums/topic/162244-easy-populate-products-attributes/?tab=comments#comment-253505

Link to comment
Share on other sites

9 minutes ago, raiwa said:

 or post in the commercial support thread.

You could also try in the official support thread, maybe someone who is also using the vendo addon can help. I never used it and can't test.

https://www.oscommerce.com/forums/topic/162244-easy-populate-products-attributes/?tab=comments#comment-253505

 

Link to comment
Share on other sites

3 minutes ago, ralgiere said:

I am very disappointed.

Easypopulate works fine, nothing wrong with the add-on. You have added a custom field, this has probably been done wrong. If you look at file easypopulate.php in your admin directory it has full instructions on how to add a custom fields. It also clearly states that custom fields only work with

"currently only works with the "products" & "products_description" table."

Simple check replace your easypopulate.php with the original and see if it produces file without errors. If yes then look at your mofified file using instructions provided in the file annd see if the mod has been done corectly. As you can see below I have added a custom field to download the GTIN from products, it works fine.

image.png.7042ed79f5530d42954af01e4ababb02.png

 

Link to comment
Share on other sites

i tried to use the original easypopulate.php but it created problems with my MVS 

I am trying to fix the vendor code when I change the two lines below it does not work and adds two check boxes for vendor

original

$custom_fields[TABLE_PRODUCTS] = array(); // this line is used if you have no custom fields to import/export
$custom_fields[TABLE_PRODUCTS_DESCRIPTION] = array(); // this line is used if you have no custom fields to import/export

 

Changed

$custom_fields[TABLE_PRODUCTS] = array( 'vendor' => 'vendor' );

$custom_fields[TABLE_PRODUCTS_DESCRIPTION] = array( 'products_short_description' => 'vendor' );

Cam someone please help me?

Edited by ralgiere
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...