♥yesudo Posted August 7, 2004 Share Posted August 7, 2004 This contrib allows you to: delete all products or delete all orders or delete all customers and perform other db manipulation operations ALL from your stores admin area. http://www.oscommerce.com/community/contributions,2324 Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥bruyndoncx Posted August 7, 2004 Share Posted August 7, 2004 Hi Emmet Just a thought, if the different action queries were stored in a database table, this script would become more generic and extensible as it could then be possible to dynamically fetch the query to execute, perhaps preview number of records affected (possibly rollback in future etc) and people could add additional queries or tweak queries more easily :) Quote KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt Link to comment Share on other sites More sharing options...
♥yesudo Posted August 7, 2004 Author Share Posted August 7, 2004 Hi EmmetJust a thought, if the different action queries were stored in a database table, this script would become more generic and extensible as it could then be possible to dynamically fetch the query to execute, perhaps preview number of records affected (possibly rollback in future etc) and people could add additional queries or tweak queries more easily :) interesting thots Carine. Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted August 8, 2004 Author Share Posted August 8, 2004 This has been rewritten and is now DB driven following a suggestion from bruyndoncx. Which makes it easier for you to build your own queries and add them to the DB and they will then show as an option in admin. Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted August 8, 2004 Author Share Posted August 8, 2004 This contrib is easy to install and here is an example of the contrib output: The queries shown above are included as part of the contrib. Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted August 9, 2004 Author Share Posted August 9, 2004 (edited) Amend Database from Admin - Version 2.0 Modified by Emmett Brosnan ------------------------------------------------ The update to this Contribution is to: 1) Allow query running from the database or from a script. 2) Add further consistency with osCommerce standards in coding. Also thank you to Aaron Hiat in this respect also. ------------------------------------------------ Edited August 9, 2004 by yesudo Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
PVK Posted August 9, 2004 Share Posted August 9, 2004 Emmet, i have added this contribution , but when i try to use the meta tag function it comes up with this error : 1054 - Unknown column 'products_head_title_tag' in 'field list' update products_description set products_head_title_tag = 'a product - The product name' where products_id = '28' [TEP STOP] Any ideads what might be causing this ? Quote Link to comment Share on other sites More sharing options...
♥yesudo Posted August 9, 2004 Author Share Posted August 9, 2004 Emmet, i have added this contribution , but when i try to use the meta tag function it comes up with this error : 1054 - Unknown column 'products_head_title_tag' in 'field list' update products_description set products_head_title_tag = 'a product - The product name' where products_id = '28' [TEP STOP] Any ideads what might be causing this ? Hi Patrick. That particular script/query/function is set to work with this contrib: http://www.oscommerce.com/community/contri...l/search,header Sorry to ask an obvious question - I assume you have that installed ? Let me know. Ta, Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
PVK Posted August 9, 2004 Share Posted August 9, 2004 Aha, so that is the reason. i don't have it installed so therefore i am getting the error ? I didn't quite understand what that contribution was for [still don't completely get it] Should i install it and what is the main reason i should [in case you say yeah,if you are going to install 1 contribution in your life that is THE contribution to pick] B) Quote Link to comment Share on other sites More sharing options...
♥yesudo Posted August 9, 2004 Author Share Posted August 9, 2004 Aha, so that is the reason.i don't have it installed so therefore i am getting the error ? I didn't quite understand what that contribution was for [still don't completely get it] Should i install it and what is the main reason i should [in case you say yeah,if you are going to install 1 contribution in your life that is THE contribution to pick] B) it is to allow for dynamic meta tags on each page - good for SEO. Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted August 19, 2004 Author Share Posted August 19, 2004 reset counter and reset sold items queries added to contrib. Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted August 25, 2004 Author Share Posted August 25, 2004 http://www.oscommerce.com/community/contributions,2324 2 added queries to this release: Mark ALL products as taxable Mark ALL products as not taxable Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted August 25, 2004 Author Share Posted August 25, 2004 Current actions included with contrib: Counter(Reset) Customers(Delete ALL) Fill Meta-Tags(Used with header tags controller contrib) Optimise Store Database Orders(Delete ALL) Products(Set ALL to inactive) Products(Set ALL to active) Products(Delete ALL) Products(Reset viewed stats) Products(Reset sold stats) Products(Set ALL to taxable) Products(Set ALL to NOT taxable) Reviews(Delete ALL) Sessions(Delete ALL) Tables (Empty ALL except required structural ones) Visitors(Delete ALL) Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted August 25, 2004 Author Share Posted August 25, 2004 Version 3 released: More user friendly version. Install instructions are the same for upgrades or new installs. Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted August 27, 2004 Author Share Posted August 27, 2004 List now: Banners (Reset Stats) Categories (Delete ALL) Counter (Reset) Customers (Delete ALL) Featured (Delete ALL) Fill Meta-Tags (Used with header tags controller contrib) Optimise Store Database Orders (Delete ALL) Products (Delete ALL) Products (Reset sold stats) Products (Reset viewed stats) Products (Set ALL to active) Products (Set ALL to inactive) Products (Set ALL to NOT taxable) Products (Set ALL to taxable) Reviews (Delete ALL) Sessions (Delete ALL) Specials (Delete ALL) Tables (Empty ALL except required structural ones) Visitors (Delete ALL) Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted August 27, 2004 Author Share Posted August 27, 2004 Contrib updated - Correction to delete all orders query. New Installs - Follow all instructions. Upgrades from V2 - Follow all instructions. Existing V3 users - just run the sql file. Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
♥yesudo Posted September 15, 2004 Author Share Posted September 15, 2004 Released: Version 4 - which will allow user input to queries(if applic). Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
Guest Posted December 31, 2004 Share Posted December 31, 2004 Before I install this contribution... Would I be able to add data into the Database i.e. can it insert data into the orders and orders_products tables? Quote Link to comment Share on other sites More sharing options...
RikR Posted December 31, 2004 Share Posted December 31, 2004 Could this contrib help me move data from one database to another? Quote Rik Rasmussen Link to comment Share on other sites More sharing options...
ts201 Posted January 21, 2005 Share Posted January 21, 2005 By : Products - Delete ALL This error : 1146 - Table 'shop.additional_images' doesn't exist delete from additional_images [TEP STOP] why ? v4.0 Quote Link to comment Share on other sites More sharing options...
♥yesudo Posted January 21, 2005 Author Share Posted January 21, 2005 By : Products - Delete ALL This error : 1146 - Table 'shop.additional_images' doesn't exist delete from additional_images [TEP STOP] why ? v4.0 <{POST_SNAPBACK}> It means that table does not exist in your db. As this contrib allows user configuration of query builds just remove the following from the table 'db_queries_desc' in your db: INSERT INTO `db_queries_desc` VALUES (82, 28, 'delete from additional_images where products_id = '); INSERT INTO `db_queries_desc` VALUES (91, 3, 'delete from additional_images'); Then run query from admin again. Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
saltandl Posted January 17, 2006 Share Posted January 17, 2006 Hey, I'm wanting to add a query to the Amend Database 4.0 contribution I have installed, but need some help. I want to delete products where I enter the product model. It looks like all tables don't have the products_model, but they do have the product_id. So can a select be added at the beginning of the "Delete Product ID" query that is already contained in the contribution and what would that look like? I'm assuming it would get the product id where the product model = user input model number. The current delete product ID query looks like this when it is inserted into the new table on install: INSERT INTO `db_queries` VALUES (28, 'Products - Delete product ID ', 'Y', 'nonscript'); INSERT INTO `db_queries_desc` VALUES (74, 28, 'delete from products where products_id = '); INSERT INTO `db_queries_desc` VALUES (75, 28, 'delete from products_description where products_id = '); INSERT INTO `db_queries_desc` VALUES (76, 28, 'delete from specials where products_id = '); INSERT INTO `db_queries_desc` VALUES (77, 28, 'delete from reviews where products_id = '); INSERT INTO `db_queries_desc` VALUES (78, 28, 'delete from products_attributes where products_id = '); INSERT INTO `db_queries_desc` VALUES (79, 28, 'delete from products_to_categories where products_id = '); INSERT INTO `db_queries_desc` VALUES (80, 28, 'delete from customers_basket where products_id = '); INSERT INTO `db_queries_desc` VALUES (81, 28, 'delete from customers_basket_attributes where products_id = '); INSERT INTO `db_queries_desc` VALUES (82, 28, 'delete from additional_images where products_id = '); Mike Quote Link to comment Share on other sites More sharing options...
♥yesudo Posted January 28, 2006 Author Share Posted January 28, 2006 (edited) Hey, I'm wanting to add a query to the Amend Database 4.0 contribution I have installed, but need some help. I want to delete products where I enter the product model. It looks like all tables don't have the products_model, but they do have the product_id. So can a select be added at the beginning of the "Delete Product ID" query that is already contained in the contribution and what would that look like? I'm assuming it would get the product id where the product model = user input model number. The current delete product ID query looks like this when it is inserted into the new table on install: INSERT INTO `db_queries` VALUES (28, 'Products - Delete product ID ', 'Y', 'nonscript'); INSERT INTO `db_queries_desc` VALUES (74, 28, 'delete from products where products_id = '); INSERT INTO `db_queries_desc` VALUES (75, 28, 'delete from products_description where products_id = '); INSERT INTO `db_queries_desc` VALUES (76, 28, 'delete from specials where products_id = '); INSERT INTO `db_queries_desc` VALUES (77, 28, 'delete from reviews where products_id = '); INSERT INTO `db_queries_desc` VALUES (78, 28, 'delete from products_attributes where products_id = '); INSERT INTO `db_queries_desc` VALUES (79, 28, 'delete from products_to_categories where products_id = '); INSERT INTO `db_queries_desc` VALUES (80, 28, 'delete from customers_basket where products_id = '); INSERT INTO `db_queries_desc` VALUES (81, 28, 'delete from customers_basket_attributes where products_id = '); INSERT INTO `db_queries_desc` VALUES (82, 28, 'delete from additional_images where products_id = '); Mike You would need to build it in script form then add it to the database e.g. Select products_id from products where products_model = input model number. Then run the Delete queries, as intimated, on the result of the above query. Because the delete queries are dependant on the result of the first query you can only achieve this via the script method for this contribution. Edited January 28, 2006 by yesudo Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
johnson4 Posted October 29, 2006 Share Posted October 29, 2006 I really like this cotrib Im just trying to add another function, Delete all Products that are inactive. I have a field called "products_status" in my products table and I want to be able to delete all the products that have a status of "0" This works of course "delete from products where products_status = 0" but "delete from products_to_categories where products_status = 0" doesn't cause "products_status" is not in the"products_to_categories" table. any thought on how to wright the script properly for this? thanks for any help Quote Link to comment Share on other sites More sharing options...
♥yesudo Posted October 29, 2006 Author Share Posted October 29, 2006 Backup and then try: $product_deletion_query = tep_db_query("select products_id from from " . TABLE_PRODUCTS . " where products_status = 0"); while ($product_deletion = tep_db_fetch_array($product_deletion_query)) { tep_db_query("delete from " . TABLE_PRODUCTS . " where products_id = '" . $product_deletion['products_id'] . "'"); tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . $product_deletion['products_id'] . "'"); } You will need to add any other relevant product tables within the while loop e.g. products_attributes, products_description etc... Quote Your online success is Paramount. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.