get the table name with prefix in magento

This is most useful when you don’t know that what will be table prefix on server side. This situation may be generate when you are developing project at local system and you know table prefix and you have no access on server side so you are not able to know what table prefix used during magento installation on server phpmyadmin.

That time you can use below code for write the table name in your custom query.
$tableName = Mage::getSingleton(‘core/resource’)->getTableName(‘product_alert_stock);


Comments

6 responses to “get the table name with prefix in magento”

Leave a Reply

Your email address will not be published. Required fields are marked *

*