Magento 2: How to get product name by sql query using product IDGet all Magento Categories using SQL queryHow to get customer shopping cart information using sql queryHow to find and replace product title using sql queryHow to get product name and image name from database using query?Magento 2: Get Product URL and SKU using SQL QueryHow to add product name to SQL QueryHow to get products name and sku and url key using sql query in magento 2?Modifying a query (get products using SQL only)Generate Magento 2 Product Feed with MySQL QueryMagento 2 delete search term through sql query
Are there practical reasons to NOT use a stepper motor with lead screw for the X and or Y axes?
Does any lore text explain why the planes of Acheron, Gehenna, and Carceri are the alignment they are?
How do I get a cleat that's stuck in a pedal, detached from the shoe, out?
How should I push back against my job assigning "homework"?
How to decline physical affection from a child whose parents are pressuring them?
How can I grammatically understand "Wir über uns"?
Can those paralyzed by the Hold Person spell be forcibly moved?
Do I add my ability modifier to the damage of the bonus-action attack granted by the Crossbow Expert feat?
Accidentally cashed a check twice
What is the best option to connect old computer to modern TV
Is there any Biblical Basis for 400 years of silence between Old and New Testament?
Why does my electric oven present the option of 40A and 50A breakers?
Can The Malloreon be read without first reading The Belgariad?
Does Peach's float negate shorthop knockback multipliers?
Cross Correlation, how can any signals except the trivial cases be uncorrelated?
Should we freeze the number of people coming in to the study for Kaplan-Meier test
Can a class take a different class's spell in their ritual book?
Asking bank to reduce APR instead of increasing credit limit
The term for the person/group a political party aligns themselves with to appear concerned about the general public
Why is there a need to modify system call tables in Linux?
Homophone fills the blanks
How can I offer a test ride while selling a bike?
Unconventional Opposites
Can a magnetic field of a large body be stronger than its gravity?
Magento 2: How to get product name by sql query using product ID
Get all Magento Categories using SQL queryHow to get customer shopping cart information using sql queryHow to find and replace product title using sql queryHow to get product name and image name from database using query?Magento 2: Get Product URL and SKU using SQL QueryHow to add product name to SQL QueryHow to get products name and sku and url key using sql query in magento 2?Modifying a query (get products using SQL only)Generate Magento 2 Product Feed with MySQL QueryMagento 2 delete search term through sql query
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I want to access the product names by query database using product ID. How can I achieve it?
magento2 product database sql
add a comment |
I want to access the product names by query database using product ID. How can I achieve it?
magento2 product database sql
u want sql query or Magento default way
– Arshad Muhammad
Dec 21 '16 at 11:32
i want sql query . I know the default way.
– Nitin Pawar
Dec 21 '16 at 11:33
why do you want using SQL query?
– chirag
Dec 21 '16 at 11:42
I want to access the product names outside magento without using api.
– Nitin Pawar
Dec 21 '16 at 11:43
add a comment |
I want to access the product names by query database using product ID. How can I achieve it?
magento2 product database sql
I want to access the product names by query database using product ID. How can I achieve it?
magento2 product database sql
magento2 product database sql
edited Dec 22 '16 at 8:06
Fabian Schmengler
55.2k21142356
55.2k21142356
asked Dec 21 '16 at 11:26
Nitin PawarNitin Pawar
79711540
79711540
u want sql query or Magento default way
– Arshad Muhammad
Dec 21 '16 at 11:32
i want sql query . I know the default way.
– Nitin Pawar
Dec 21 '16 at 11:33
why do you want using SQL query?
– chirag
Dec 21 '16 at 11:42
I want to access the product names outside magento without using api.
– Nitin Pawar
Dec 21 '16 at 11:43
add a comment |
u want sql query or Magento default way
– Arshad Muhammad
Dec 21 '16 at 11:32
i want sql query . I know the default way.
– Nitin Pawar
Dec 21 '16 at 11:33
why do you want using SQL query?
– chirag
Dec 21 '16 at 11:42
I want to access the product names outside magento without using api.
– Nitin Pawar
Dec 21 '16 at 11:43
u want sql query or Magento default way
– Arshad Muhammad
Dec 21 '16 at 11:32
u want sql query or Magento default way
– Arshad Muhammad
Dec 21 '16 at 11:32
i want sql query . I know the default way.
– Nitin Pawar
Dec 21 '16 at 11:33
i want sql query . I know the default way.
– Nitin Pawar
Dec 21 '16 at 11:33
why do you want using SQL query?
– chirag
Dec 21 '16 at 11:42
why do you want using SQL query?
– chirag
Dec 21 '16 at 11:42
I want to access the product names outside magento without using api.
– Nitin Pawar
Dec 21 '16 at 11:43
I want to access the product names outside magento without using api.
– Nitin Pawar
Dec 21 '16 at 11:43
add a comment |
4 Answers
4
active
oldest
votes
Magento uses an EAV table structure for products. Names are stored in catalog_product_entity_varchar
. If you have the product ID X, you can query this table directly:
SELECT entity_id, value, store_id FROM catalog_product_entity_varchar
WHERE entity_id = X AND attribute_id = (
SELECT attribute_id FROM eav_attribute
WHERE entity_type_id=4 AND attribute_code='name'
)
The subquery determines the attribute id for "name", entity_type_id 4 is always the type ID for products.
Note that in a multistore setup you might get multiple values per product. Pay attention to the "store_id" column. "0" stands for the default value.
add a comment |
Use below query to find name from product_id
SELECT
value
FROMcatalog_product_entity_varchar
WHERE entity_id=2
AND (attribute_id IN(SELECTattribute_id
FROMeav_attribute
WHERE
attribute_code
= "name" ANDentity_type_id
= 4))
Change entity_id=2
as per your product id
add a comment |
If your product's id is 1234:
select value from catalog_product_entity_varchar left join eav_attribute on
eav_attribute.attribute_id = catalog_product_entity_varchar.attribute_id
where
eav_attribute.attribute_code='name' and
catalog_product_entity_varchar.entity_id=1234
there is norow_id
column, useentity_id
instead ofrow_id
.
– chirag
Dec 21 '16 at 12:04
In Magento 2 you have row_id
– Phoenix128_RiccardoT
Dec 21 '16 at 12:21
what? can you share screenshot of your database table?
– chirag
Dec 21 '16 at 12:21
Magento EE has row_id.
– nikola99
Feb 1 '17 at 0:03
add a comment |
Or you can try this also,for single record, X is your product_id you have to replace it by your own product id.
SELECT DISTINCT value FROM catalog_product_entity_varchar WHERE entity_id=X AND (attribute_id IN(SELECT attribute_id FROM eav_attribute WHERE attribute_code = "name" AND entity_type_id = 4))
New contributor
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f151303%2fmagento-2-how-to-get-product-name-by-sql-query-using-product-id%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Magento uses an EAV table structure for products. Names are stored in catalog_product_entity_varchar
. If you have the product ID X, you can query this table directly:
SELECT entity_id, value, store_id FROM catalog_product_entity_varchar
WHERE entity_id = X AND attribute_id = (
SELECT attribute_id FROM eav_attribute
WHERE entity_type_id=4 AND attribute_code='name'
)
The subquery determines the attribute id for "name", entity_type_id 4 is always the type ID for products.
Note that in a multistore setup you might get multiple values per product. Pay attention to the "store_id" column. "0" stands for the default value.
add a comment |
Magento uses an EAV table structure for products. Names are stored in catalog_product_entity_varchar
. If you have the product ID X, you can query this table directly:
SELECT entity_id, value, store_id FROM catalog_product_entity_varchar
WHERE entity_id = X AND attribute_id = (
SELECT attribute_id FROM eav_attribute
WHERE entity_type_id=4 AND attribute_code='name'
)
The subquery determines the attribute id for "name", entity_type_id 4 is always the type ID for products.
Note that in a multistore setup you might get multiple values per product. Pay attention to the "store_id" column. "0" stands for the default value.
add a comment |
Magento uses an EAV table structure for products. Names are stored in catalog_product_entity_varchar
. If you have the product ID X, you can query this table directly:
SELECT entity_id, value, store_id FROM catalog_product_entity_varchar
WHERE entity_id = X AND attribute_id = (
SELECT attribute_id FROM eav_attribute
WHERE entity_type_id=4 AND attribute_code='name'
)
The subquery determines the attribute id for "name", entity_type_id 4 is always the type ID for products.
Note that in a multistore setup you might get multiple values per product. Pay attention to the "store_id" column. "0" stands for the default value.
Magento uses an EAV table structure for products. Names are stored in catalog_product_entity_varchar
. If you have the product ID X, you can query this table directly:
SELECT entity_id, value, store_id FROM catalog_product_entity_varchar
WHERE entity_id = X AND attribute_id = (
SELECT attribute_id FROM eav_attribute
WHERE entity_type_id=4 AND attribute_code='name'
)
The subquery determines the attribute id for "name", entity_type_id 4 is always the type ID for products.
Note that in a multistore setup you might get multiple values per product. Pay attention to the "store_id" column. "0" stands for the default value.
answered Dec 21 '16 at 11:44
Fabian SchmenglerFabian Schmengler
55.2k21142356
55.2k21142356
add a comment |
add a comment |
Use below query to find name from product_id
SELECT
value
FROMcatalog_product_entity_varchar
WHERE entity_id=2
AND (attribute_id IN(SELECTattribute_id
FROMeav_attribute
WHERE
attribute_code
= "name" ANDentity_type_id
= 4))
Change entity_id=2
as per your product id
add a comment |
Use below query to find name from product_id
SELECT
value
FROMcatalog_product_entity_varchar
WHERE entity_id=2
AND (attribute_id IN(SELECTattribute_id
FROMeav_attribute
WHERE
attribute_code
= "name" ANDentity_type_id
= 4))
Change entity_id=2
as per your product id
add a comment |
Use below query to find name from product_id
SELECT
value
FROMcatalog_product_entity_varchar
WHERE entity_id=2
AND (attribute_id IN(SELECTattribute_id
FROMeav_attribute
WHERE
attribute_code
= "name" ANDentity_type_id
= 4))
Change entity_id=2
as per your product id
Use below query to find name from product_id
SELECT
value
FROMcatalog_product_entity_varchar
WHERE entity_id=2
AND (attribute_id IN(SELECTattribute_id
FROMeav_attribute
WHERE
attribute_code
= "name" ANDentity_type_id
= 4))
Change entity_id=2
as per your product id
answered Dec 21 '16 at 11:47
Prashant ValandaPrashant Valanda
9,98212456
9,98212456
add a comment |
add a comment |
If your product's id is 1234:
select value from catalog_product_entity_varchar left join eav_attribute on
eav_attribute.attribute_id = catalog_product_entity_varchar.attribute_id
where
eav_attribute.attribute_code='name' and
catalog_product_entity_varchar.entity_id=1234
there is norow_id
column, useentity_id
instead ofrow_id
.
– chirag
Dec 21 '16 at 12:04
In Magento 2 you have row_id
– Phoenix128_RiccardoT
Dec 21 '16 at 12:21
what? can you share screenshot of your database table?
– chirag
Dec 21 '16 at 12:21
Magento EE has row_id.
– nikola99
Feb 1 '17 at 0:03
add a comment |
If your product's id is 1234:
select value from catalog_product_entity_varchar left join eav_attribute on
eav_attribute.attribute_id = catalog_product_entity_varchar.attribute_id
where
eav_attribute.attribute_code='name' and
catalog_product_entity_varchar.entity_id=1234
there is norow_id
column, useentity_id
instead ofrow_id
.
– chirag
Dec 21 '16 at 12:04
In Magento 2 you have row_id
– Phoenix128_RiccardoT
Dec 21 '16 at 12:21
what? can you share screenshot of your database table?
– chirag
Dec 21 '16 at 12:21
Magento EE has row_id.
– nikola99
Feb 1 '17 at 0:03
add a comment |
If your product's id is 1234:
select value from catalog_product_entity_varchar left join eav_attribute on
eav_attribute.attribute_id = catalog_product_entity_varchar.attribute_id
where
eav_attribute.attribute_code='name' and
catalog_product_entity_varchar.entity_id=1234
If your product's id is 1234:
select value from catalog_product_entity_varchar left join eav_attribute on
eav_attribute.attribute_id = catalog_product_entity_varchar.attribute_id
where
eav_attribute.attribute_code='name' and
catalog_product_entity_varchar.entity_id=1234
edited Dec 21 '16 at 12:17
chirag
2,1351830
2,1351830
answered Dec 21 '16 at 11:49
Phoenix128_RiccardoTPhoenix128_RiccardoT
5,34121231
5,34121231
there is norow_id
column, useentity_id
instead ofrow_id
.
– chirag
Dec 21 '16 at 12:04
In Magento 2 you have row_id
– Phoenix128_RiccardoT
Dec 21 '16 at 12:21
what? can you share screenshot of your database table?
– chirag
Dec 21 '16 at 12:21
Magento EE has row_id.
– nikola99
Feb 1 '17 at 0:03
add a comment |
there is norow_id
column, useentity_id
instead ofrow_id
.
– chirag
Dec 21 '16 at 12:04
In Magento 2 you have row_id
– Phoenix128_RiccardoT
Dec 21 '16 at 12:21
what? can you share screenshot of your database table?
– chirag
Dec 21 '16 at 12:21
Magento EE has row_id.
– nikola99
Feb 1 '17 at 0:03
there is no
row_id
column, use entity_id
instead of row_id
.– chirag
Dec 21 '16 at 12:04
there is no
row_id
column, use entity_id
instead of row_id
.– chirag
Dec 21 '16 at 12:04
In Magento 2 you have row_id
– Phoenix128_RiccardoT
Dec 21 '16 at 12:21
In Magento 2 you have row_id
– Phoenix128_RiccardoT
Dec 21 '16 at 12:21
what? can you share screenshot of your database table?
– chirag
Dec 21 '16 at 12:21
what? can you share screenshot of your database table?
– chirag
Dec 21 '16 at 12:21
Magento EE has row_id.
– nikola99
Feb 1 '17 at 0:03
Magento EE has row_id.
– nikola99
Feb 1 '17 at 0:03
add a comment |
Or you can try this also,for single record, X is your product_id you have to replace it by your own product id.
SELECT DISTINCT value FROM catalog_product_entity_varchar WHERE entity_id=X AND (attribute_id IN(SELECT attribute_id FROM eav_attribute WHERE attribute_code = "name" AND entity_type_id = 4))
New contributor
add a comment |
Or you can try this also,for single record, X is your product_id you have to replace it by your own product id.
SELECT DISTINCT value FROM catalog_product_entity_varchar WHERE entity_id=X AND (attribute_id IN(SELECT attribute_id FROM eav_attribute WHERE attribute_code = "name" AND entity_type_id = 4))
New contributor
add a comment |
Or you can try this also,for single record, X is your product_id you have to replace it by your own product id.
SELECT DISTINCT value FROM catalog_product_entity_varchar WHERE entity_id=X AND (attribute_id IN(SELECT attribute_id FROM eav_attribute WHERE attribute_code = "name" AND entity_type_id = 4))
New contributor
Or you can try this also,for single record, X is your product_id you have to replace it by your own product id.
SELECT DISTINCT value FROM catalog_product_entity_varchar WHERE entity_id=X AND (attribute_id IN(SELECT attribute_id FROM eav_attribute WHERE attribute_code = "name" AND entity_type_id = 4))
New contributor
New contributor
answered May 25 at 5:14
suraj dakresuraj dakre
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f151303%2fmagento-2-how-to-get-product-name-by-sql-query-using-product-id%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
u want sql query or Magento default way
– Arshad Muhammad
Dec 21 '16 at 11:32
i want sql query . I know the default way.
– Nitin Pawar
Dec 21 '16 at 11:33
why do you want using SQL query?
– chirag
Dec 21 '16 at 11:42
I want to access the product names outside magento without using api.
– Nitin Pawar
Dec 21 '16 at 11:43