sql error after update when copy product

  • Posts: 52
  • Thank you received: 0
8 years 8 months ago #250808

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.6
-- Error-message(debug-mod must be tuned on) -- :

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','0','0'),('plextor_m8pe_128gb_nvm_express__ssd_m_2_pcie_gen_3_0_speed1600mb_' at line 1 SQL=INSERT IGNORE INTO #__hikashop_file (`file_name`,`file_description`,`file_path`,`file_type`,`file_ref_id`,`file_ordering`,`file_free_download`,`file_limit`) VALUES ('plextor_m8pe_128gb_nvm_express__ssd_m_2_pcie_gen_3_0_speed1600mb_write500mb_controller_marvell_88ss1093_nand_flash_toshiba_15nm_toggle_mlc_dram_cache_512mb-lpddr3_m_2_2280_nvme3_1155796225','','plextor_m8pe_128gb_nvm_express__ssd_m_2_pcie_gen_3_0_speed1600mb_write500mb_controller_marvell_88ss1093_nand_flash_toshiba_15nm_toggle_mlc_dram_cache_512mb-lpddr3_m_2_2280_nvme3_1155796225.jpg','product',,'0','0','0'),('plextor_m8pe_128gb_nvm_express__ssd_m_2_pcie_gen_3_0_speed1600mb_write500mb_controller_marvell_88ss1093_nand_flash_toshiba_15nm_toggle_mlc_dram_cache_512mb-lpddr3_m_2_2280_nvme4_1973255987','','plextor_m8pe_128gb_nvm_express__ssd_m_2_pcie_gen_3_0_speed1600mb_write500mb_controller_marvell_88ss1093_nand_flash_toshiba_15nm_toggle_mlc_dram_cache_512mb-lpddr3_m_2_2280_nvme4_1973255987.jpg','product',,'1','0','0'),('plextor_m8pe_128gb_nvm_express__ssd_m_2_pcie_gen_3_0_speed1600mb_write500mb_controller_marvell_88ss1093_nand_flash_toshiba_15nm_toggle_mlc_dram_cache_512mb-lpddr3_m_2_2280_nvme1_210542254','','plextor_m8pe_128gb_nvm_express__ssd_m_2_pcie_gen_3_0_speed1600mb_write500mb_controller_marvell_88ss1093_nand_flash_toshiba_15nm_toggle_mlc_dram_cache_512mb-lpddr3_m_2_2280_nvme1_210542254.jpg','product',,'2','0','0'),('plextor_m8pe_128gb_nvm_express__ssd_m_2_pcie_gen_3_0_speed1600mb_write500mb_controller_marvell_88ss1093_nand_flash_toshiba_15nm_toggle_mlc_dram_cache_512mb-lpddr3_m_2_2280_nvme2_1720384498','','plextor_m8pe_128gb_nvm_express__ssd_m_2_pcie_gen_3_0_speed1600mb_write500mb_controller_marvell_88ss1093_nand_flash_toshiba_15nm_toggle_mlc_dram_cache_512mb-lpddr3_m_2_2280_nvme2_1720384498.jpg','product',,'3','0','0')

hi
when i update from 2.6.2 to 2.6.4 every thing is ok but in some product when i select a product and click on copy button it give me that error. and don't create a copy and the main product get lost.
(it happen in some product not all product . in new product after update and in old product before update give that error)
i remove cropped product manually in database in product table.

Last edit: 8 years 8 months ago by Jerome. Reason: [code] is nice

Please Log in or Create an account to join the conversation.

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
8 years 8 months ago #250811

Hi,

Try changing the line:

$value = array($this->db->Quote($file->file_name),$this->db->Quote($file->file_description),$this->db->Quote($file->file_path),$this->db->Quote($db_type),$product->product_id,$this->db->Quote($file->file_ordering),$this->db->Quote($file->file_free_download),$this->db->Quote($file->file_limit));
to:
$value = array($this->db->Quote($file->file_name),$this->db->Quote($file->file_description),$this->db->Quote($file->file_path),$this->db->Quote($db_type),(int)$product->product_id,$this->db->Quote($file->file_ordering),$this->db->Quote($file->file_free_download),$this->db->Quote($file->file_limit));
in the file administrator/components/com_hikashop/helpers/import.php

The following user(s) said Thank You: jafar007

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
8 years 8 months ago #250874

i must change this line in every update?

i change that line but error change to this:

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 '15),(46,,27)' at line 1 SQL=INSERT IGNORE INTO #__hikashop_product_category (`category_id`,`product_id`,`ordering`) VALUES (48,,15),(46,,27)

Last edit: 8 years 8 months ago by jafar007.

Please Log in or Create an account to join the conversation.

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
8 years 8 months ago #250881

No. Let us know how it works. If that fixes the problem, we can include it for the next version of HikaShop.

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
8 years 8 months ago #251212

now,what shod i do?

Please Log in or Create an account to join the conversation.

  • Posts: 26251
  • Thank you received: 4040
  • MODERATOR
8 years 8 months ago #251241

Hi,

The error you got is another error ; but the problem is the exact same kind.

You can replace the line

$value = array((int)$id,$product->product_id,$orderings[(int)$id]);
By
$value = array((int)$id,(int)$product->product_id,$orderings[(int)$id]);
In order to avoid the error.

But even if it will not generate an error ; the content is not correct and the fact that you have an error indicate that you do not have any "product ID" ; which is the source of the problem and the SQL error is just a side effect.
A product without ID is a product which is not in the database ; it is a product which has not been imported ; it is your real issue.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: jafar007

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
8 years 8 months ago #251276

i made change and i don't get any error but don't show any copied product .
in database in hikashop_product table created product. but in hikashop_product_category don't create product ID
you can see my screen shot.
i must delete product manually in database.





some times when change something in product and save that every thing be ok and i can copy product correctly

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
8 years 8 months ago #251280

Hi,

If you don't have anything for the product in hikashop_product_category, click on the "check database" button of the HikaShop configuration. That will link automatically all the products without a category to the main category of your shop.

The following user(s) said Thank You: jafar007

Please Log in or Create an account to join the conversation.

Time to create page: 0.093 seconds
Powered by Kunena Forum