- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2017
07:54 AM
07-03-2017
07:54 AM
Hello
It's me again as you know i'm new in Magento and something is disturbing me i'm searching a way to call the database prefix set in the begining of the installation like _DB_PREFIX_ in Prestashop but every post i saw about this wasn't really clear and very complicated for something that simple can someone tell me if there is a simple way pls ?
Solved! Go to Solution.
Labels:
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2017
11:09 AM
07-03-2017
11:09 AM
If you want to get table name into your install schema then use below link for reference
https://mage2.pro/t/topic/529/2
Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2017
08:50 AM
07-03-2017
08:50 AM
Re: Call The Table Prefix
You can get tablename like below way,
$obj = \Magento\Framework\App\ObjectManager::getInstance(); $connection = $obj->get('Magento\Framework\App\ResourceConnection')->getConnection(); $prefixTablename = $connection->getTableName('tablename'); // pass your tablename echo $prefixTablename;
Please let me know if you have query or I am wrong.
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial
Magento 2 Blogs/Tutorial
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2017
11:09 AM
07-03-2017
11:09 AM
If you want to get table name into your install schema then use below link for reference
https://mage2.pro/t/topic/529/2
Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2017
12:28 AM
07-04-2017
12:28 AM
Re: Call The Table Prefix
thanks you