get table prefix in magento

when we will work on Data Base table with custom Query . than it is very important to know what is the table prefix of the magento data base table. This magento blog or magento tutorial will tell you how to get the table Prefix in magento.

In 2 ways you will get data base table prefix.

1) echo $tablePrefix = (string) Mage::getConfig()->getTablePrefix();

2) Go to app/etc/local.xml open local.xml file. and see

                <db>
                <table_prefix><![CDATA['SEE YOUR TABLE PREFIX HERE ']]></table_prefix>
               </db>


No comments:

Post a Comment