I need to add a model number to all my products in order for the Easy Populate contrib to work. The model number does not have to be specific to anything, just an arbitrary number. Is there a SQL command I could use to insert a model number into ALL products in one shot?
Please advise ASAP.
Thanks
Rob
Latest News: (loading..)
Adding Model Number via MySQL
Started by roback, Jul 31 2009, 17:16
6 replies to this topic
#1
Posted 31 July 2009, 17:16
#2
Posted 31 July 2009, 18:20
Make sure to backup your database first. If something goes wrong you can restore it.
Using phpmyadmin click on the sql tab and run this query
Using phpmyadmin click on the sql tab and run this query
UPDATE `products` SET `products_model` = '123'Again backup first.
Remember to backup database, files and pictures.
I reject your reality and substitute my own.
My mind not only wanders, it sometimes leaves completely.
The problem with the gene pool is that there is no lifeguard.
Everyone’s entitled to my opinion.
Links
Security
SSL Help
Basics for design
Basics for design V2.3+
How Do I ...?
I reject your reality and substitute my own.
My mind not only wanders, it sometimes leaves completely.
The problem with the gene pool is that there is no lifeguard.
Everyone’s entitled to my opinion.
Links
Security
SSL Help
Basics for design
Basics for design V2.3+
How Do I ...?
#3
Posted 31 July 2009, 19:43
bktrain, on Jul 31 2009, 12:20 PM, said:
Make sure to backup your database first. If something goes wrong you can restore it.
Using phpmyadmin click on the sql tab and run this query
Using phpmyadmin click on the sql tab and run this query
UPDATE `products` SET `products_model` = '123'Again backup first.
Hmmm... okay that put 123 in the model # for all of them. Maybe I was unclear that I want that number to be unique for each, but doesn't have to correspond to any of the products per sae.
So please advise how I can take what you have now done - products_model = 123 for all and change to an unique value for each or I can restore the backup and do it from fresh. which ever is easiest.
Thanks for the help!
#4
Posted 31 July 2009, 22:25
Well looks like I did misunderstand you. Why can't you use easy populate? This sort of thing is what it is for.
Restore your original info in your db. Using 1 simple query in phpmyadmin will set all of those fields to the same value. So you don't want to do it that way.
Restore your original info in your db. Using 1 simple query in phpmyadmin will set all of those fields to the same value. So you don't want to do it that way.
Remember to backup database, files and pictures.
I reject your reality and substitute my own.
My mind not only wanders, it sometimes leaves completely.
The problem with the gene pool is that there is no lifeguard.
Everyone’s entitled to my opinion.
Links
Security
SSL Help
Basics for design
Basics for design V2.3+
How Do I ...?
I reject your reality and substitute my own.
My mind not only wanders, it sometimes leaves completely.
The problem with the gene pool is that there is no lifeguard.
Everyone’s entitled to my opinion.
Links
Security
SSL Help
Basics for design
Basics for design V2.3+
How Do I ...?
#5
Posted 01 August 2009, 00:03
bktrain, on Jul 31 2009, 04:25 PM, said:
Well looks like I did misunderstand you. Why can't you use easy populate? This sort of thing is what it is for.
Restore your original info in your db. Using 1 simple query in phpmyadmin will set all of those fields to the same value. So you don't want to do it that way.
Restore your original info in your db. Using 1 simple query in phpmyadmin will set all of those fields to the same value. So you don't want to do it that way.
Okay, so how can I do it? EP requires the model number to function properly... for some reason it references that, and not the product id. Sadly I uploaded my products without and model # so EP is almost useless to me... hence why I want to insert a unique model number through a query.
Any ideas?
Rob
#6
Posted 01 August 2009, 01:44
That soesn't make sense to me. I don't use ep myself but it should give a place to enter your model number whether they are empty or not.
Try posting in the support thread. Maybe someone has had this problem before. Support Thread
Try posting in the support thread. Maybe someone has had this problem before. Support Thread
Remember to backup database, files and pictures.
I reject your reality and substitute my own.
My mind not only wanders, it sometimes leaves completely.
The problem with the gene pool is that there is no lifeguard.
Everyone’s entitled to my opinion.
Links
Security
SSL Help
Basics for design
Basics for design V2.3+
How Do I ...?
I reject your reality and substitute my own.
My mind not only wanders, it sometimes leaves completely.
The problem with the gene pool is that there is no lifeguard.
Everyone’s entitled to my opinion.
Links
Security
SSL Help
Basics for design
Basics for design V2.3+
How Do I ...?
#7
Posted 01 August 2009, 15:24
bktrain, on Jul 31 2009, 07:44 PM, said:
That soesn't make sense to me. I don't use ep myself but it should give a place to enter your model number whether they are empty or not.
Try posting in the support thread. Maybe someone has had this problem before. Support Thread
Try posting in the support thread. Maybe someone has had this problem before. Support Thread
It doesn't make sense to me why EP does not export the product ID # as well, but how it works with the model number is if you export it with NO model number, add a model number and upload it, it sees that as two different models, so it adds a new (duplicate) product. I didn't create this contrib, but it certainly seems like an oversight.
So is there a way to populate the column product_model with unique values per item?
Is there a way to copy the values from another column (say the product_id) to the product_model column?
thanks for the help.














