trying to update _hickashop_product.product_id col

  • Posts: 5
  • Thank you received: 0
13 years 7 months ago #13968

Hi,
I'm using Chronoforms as an interface for users to add products to the system, but I can't seem to update the "product_id" column in the hickashop_product columns. I can update any other column in that table (and in the other tables that are affected when a product is added...)


Here's the prob - If I remove the field that updates "product_id" from my form, all works well and I get the following query (from Joomla debug info...):

UPDATE `jos_hikashop_product`
  SET `product_code`='3000'
  WHERE product_id='3000'

As soon as add a field in my form that updates the "product_id" column, I get a totally different query in the debug area:
#
UPDATE `jos_hikashop_product`
  SET `product_id`='3000'
  WHERE product_code='3000'

I can run a query in PhpMyAdmin that updates this column very easily, but for some reason when I try to use chronoforms I get the different query that doesn't work. I've contacted the Chronoforms guys but no solutions - we've been working on this for a few weeks now.

Am I totally missing something?

Thanx!!!!


Mark

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

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #13989

The product_id column is automatically filled by mysql as it is an auto increment column. You should not change it. If you change it without changing it everywhere it's used, you will loose a lot of information of your product (prices, variants, related items, categories,images, files...).

Could you explain why you're trying to have a form changing the product_id column ?

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

  • Posts: 5
  • Thank you received: 0
13 years 7 months ago #13991

Thanx for your response -

I need users to be able to add their own products.
I have everything worked out so that, when a new product is added, the new product id is populated into the relevant columns -
so, everything's done, I just can't get the hickashop_product.product_id column to update...

It's totally fine if relevant product, etc. don't update as I won't be using that part of the cart.

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

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #14001

So you're saying that chronoforms is generating a query which is different from the ones you posted above and which doesn't work. Could you copy/paste the query which doesn't work ? What error do you have ?
If you run it in phpmyadmin, do you get an error ?

That seems to be a problem in chronoforms so you should get more help from them than us as we don't know how chronoforms works.

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

  • Posts: 5
  • Thank you received: 0
13 years 7 months ago #14011

From my post above:

As soon as add a field in my form that updates the "product_id" column, I get a totally different query in the debug area:


#
UPDATE `jos_hikashop_product`
SET `product_id`='3000'
WHERE product_code='3000'



I can run a query in PhpMyAdmin that updates this column very easily, but for some reason when I try to use chronoforms I get the different query that doesn't work. I've contacted the Chronoforms guys but no solutions - we've been working on this for a few weeks now.



I agree that it seems like a CF issue, but they're stumped as well, wanted to make sure I wasn't missing something related to hikashop....

Also, I don't get any errors, simply no input in the database...

Last edit: 13 years 7 months ago by marklandry.

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

  • Posts: 82865
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #14016

So if you don't get any error, it means that the query works. Maybe the problem comes from another query later on in the process which revert the modification ?

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

Time to create page: 0.062 seconds
Powered by Kunena Forum