Adding product?
Adding product?
Was adding products and everything was working perfect.
Now when product is added, completes the addition with no errors but new product doesn't show in the product list
Checking in the database shows 0 for product id rather than the sequential product number.
1.0.8.0
Now when product is added, completes the addition with no errors but new product doesn't show in the product list
Checking in the database shows 0 for product id rather than the sequential product number.
1.0.8.0
Re: Adding product?
Not sure what the issue actually was.
Stupid mans fix!
Go into products and change the product id to next sequential number.
Go into products_to_categories and make same number change
We'll see when I add another product.
Stupid mans fix!
Go into products and change the product id to next sequential number.
Go into products_to_categories and make same number change
We'll see when I add another product.
-
- PhoenixCart Developer
- Posts: 1210
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
- Has thanked: 38 times
- Been thanked: 103 times
Re: Adding product?
Check that in the database products table the products id has auto increment set.
I’m also wondering how you got this screwed up. Do you have a dB backup from a point where your settings were correct. It might be easier to restore even you have to enter some products again.
I’m also wondering how you got this screwed up. Do you have a dB backup from a point where your settings were correct. It might be easier to restore even you have to enter some products again.
Last edited by raiwa on Fri Apr 02, 2021 7:26 pm, edited 1 time in total.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
Re: Adding product?
Still won't auto increment
SQL query:
ALTER TABLE `products`
MODIFY `products_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=334
MySQL said: Documentation
#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key
-
- PhoenixCart Developer
- Posts: 1210
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
- Has thanked: 38 times
- Been thanked: 103 times
Re: Adding product?
Then check if you have another column set to auto increment and remove it.
Or recover a backup, if you have, from a point where the settings where ok.
I wonder how you got these settings wrong.
Or recover a backup, if you have, from a point where the settings where ok.
I wonder how you got these settings wrong.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
Re: Adding product?
product_id is Primary and only key set on products table.
Refuses to auto_increment.
Refuses to auto_increment.
You do not have the required permissions to view the files attached to this post.
-
- Lead Developer
- Posts: 2656
- Joined: Tue Nov 05, 2019 6:02 pm
- Has thanked: 4 times
- Been thanked: 182 times
Re: Adding product?
OK. Try the ALTER statement again. It's certainly not going to auto-increment until you set it to auto-increment.
And note, what you need to check is not that it is the only key but that it is the only auto-increment column.
-
- Lead Developer
- Posts: 2656
- Joined: Tue Nov 05, 2019 6:02 pm
- Has thanked: 4 times
- Been thanked: 182 times
Re: Adding product?
Code: Select all
ALTER TABLE `products`
MODIFY `products_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=334
Code: Select all
ALTER TABLE `products`
MODIFY `products_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, AUTO_INCREMENT=334
Re: Adding product?
@ecartz Thanks ever so much, that worked perfectlyecartz wrote: ↑Sat Apr 03, 2021 3:49 amHere's the problem. The PRIMARY is not in that statement. So when you run it, it tries to remove the primary key and then it can't be used as an auto_increment. TryCode: Select all
ALTER TABLE `products` MODIFY `products_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=334
That should retain the status as a key and add the auto_increment property.Code: Select all
ALTER TABLE `products` MODIFY `products_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, AUTO_INCREMENT=334