Where are customizer settings stored in db for wordpress theme?

How to clone customizer settings in child theme from parent theme? The customizer data is stored in table wp_options under option_name theme_mods_THEME-NAME you can view all such settings via the following query: SELECT * FROM `wp_options` WHERE `option_name` LIKE "theme_mods_%" In some cases, you just want to use parent theme’s settings in newly added child theme. If that is your case too, use the following queries to utilize and close those settings for your child theme also. ...

May 6, 2021 · 1 min · Harshvardhan Malpani

How to disable products in Magento2 which dont have any gallery image?

UPDATE `catalog_product_entity_int` SET `value`=2 where `entity_id` in (SELECT a.`entity_id` FROM `catalog_product_entity` AS a LEFT JOIN `catalog_product_entity_media_gallery_value` AS b ON a.entity_id = b.entity_id LEFT JOIN `catalog_product_entity_media_gallery` AS c ON b.value_id = c.value_id WHERE c.value IS NULL) and `attribute_id` = 96 It is SQL query Assumption: value=2 means disable and value=1 means enable attribute_id=96 means “status” attribute References: https://gist.github.com/tegansnyder/8464261#gistcomment-2910808 https://magento.stackexchange.com/a/83033/32283

August 22, 2019 · 1 min · Harshvardhan Malpani

Some of the most important SQL commands.

SQL, Structured Query Language, is a programming language designed to manage data stored in relational databases. SQL operates through simple, declarative statements. This keeps data accurate and secure, and it helps maintain the integrity of databases, regardless of size. Most of the actions you need to perform on a database are done with SQL statements. SQL commands are grouped into four major categories depending on their functionality: Data Definition Language (DDL) Data Manipulation Language (DML) Transaction Control Language (TCL) Data Control Language (DCL) COMMANDS: SELECT SELECT column_name FROM table_name; SELECT statements are used to fetch data from a database ( extracts data from a database ). Every query will begin with SELECT. ...

January 24, 2019 · 2 min · Harshvardhan Malpani

Simple joining of data from two different tables on basis of a common key

SELECT a.user_id,a.meta_value,b.user_login FROM `e_usermeta` a,`e_users` b where a.meta_key="phoneno" and a.user_id=b.ID SELECT a.user_id,a.meta_value,b.user_pass,b.user_login FROM `e_usermeta` a,`e_users` b where a.meta_key="phoneno" and a.user_id=b.ID order by b.user_login UPDATE `wp_users` a,`tmptable` b SET a.`user_pass`=b.`usp` where a.`user_login`=b.`ulogin`;

August 7, 2018 · 1 min · Harshvardhan Malpani

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry Magento 2

SELECT u.value_id,u2.value_id, u.attribute_id, u.entity_id, u.value FROM catalog_product_entity_int u, catalog_product_entity_int u2 WHERE u.entity_id = u2.entity_id AND u.attribute_id = u2.attribute_id AND u.value= u2.value and u.value_id<u2.value_id DELETE FROM catalog_product_entity_int WHERE value_id IN ( SELECT u.value_id as value_id FROM catalog_product_entity_int u, catalog_product_entity_int u2 WHERE u.entity_id = u2.entity_id AND u.attribute_id = u2.attribute_id AND u.value= u2.value and u.store_id=u2.store_id and u.value_id<u2.value_id )

May 29, 2018 · 1 min · Harshvardhan Malpani