Amadek Posted February 12 Share Posted February 12 (edited) I need to create a product attribute such as “Product weight (grams)” and “Weight including packaging (grams).” I want to automatically create values for this trait from 1 to 10000. There is no way to create something like this manually because it is too much work. I need to write a script that will add such values to the database automatically. Do you have any ideas? To which table in the database should I add this? Edited February 13 by Amadek (see edit history) Link to comment Share on other sites More sharing options...
Amadek Posted February 12 Author Share Posted February 12 I found solution: #include <stdio.h> int main() { int i=1; while(i<=1000) printf("INSERT INTO `feature_value`(`id_feature_value`, `id_feature`, `custom`) VALUES ('%d','3','0');\n",i++); } int main() { int beton=1; int i=1; while(i<=10000) printf("INSERT INTO `feature_value_lang`(`id_feature_value`, `id_lang`, `value`) VALUES ('%d','1','%d');\n",i++,beton++); } Enjoy Link to comment Share on other sites More sharing options...
Divine Posted February 12 Share Posted February 12 (edited) Thank you ! Don't forget to edit your first post and to add [Solved] in the title Edited February 12 by Divine (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now