We have a prefix in our Magento DB: prefix_

Now, Magento has been working fine for years. But in one of the extension when we call the code below. Instead of printing prefix_catalog_product_index_price it prints catalog_product_index_price. The prefix_ is missing.

prefix_catalog_product_index_price exists in the database just like all the other tables.

$adapter = Mage::getResourceSingleton('core/resource')->getReadConnection();


$adapter = Mage::getSingleton('core/resource')->getConnection('core_read');

What can this be?

Why is getTableName not working? or adding the prefix?

2 Answers 2


Maybe it's a little bit late, but for anyone who is searching for the correct answer here it is


It will returns "yourtableprefix_customer_entity"

$connection = Mage::getSingleton('core/resource');

In Catalog module config.xml Magento define this table entity is product_index_price


for getting a table with prefix then try


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.