Getting products with or without custom options using SQL (Magento 1)

To get all products that do not have custom options, simply run the following SQL query:

To get all products that do have custom options, remove the “NOT” from the above query.

Solving the “Invalid backend model specified: catalog/attribute_backend_customlayoutupdate” problem (Magento 1)

Run the following query:

Remember the attribute_ids from that query and run the following query:

Done!

Getting the status of every product in the database using MySQL (Magento 1)

The following MySQL query returns the status of every product in the Magento database.

Status 1: active Status 2: not active

Calling a stored procedure from Magento

Using the code below you can call a stored procedure directly from Magento.

Getting orders with items that have a certain attribute set (Magento 1)

The following MySQL query returns all Magento orders that have at least one item with attribute set id 9.

Deleting upsell products directly in the database (Magento 1)

Once saved, upsell products can not be removed again easily. Using the following MySQL script, you can delete Magento upsell products from the database.