Our blog

 

Get Table Name in Magento (eg with Table Prefix)

If you use table prefixes (you should) but you need to get the name of a table without having to hardcode in the table prefix, use this little snippet:

PHP:
  1. $tableName = Mage::getSingleton('core/resource')->getTableName('catalog_product_option');

More Reading:

One Comments

Sam
June 21st, 2010

Nice one for posting this - helped me get around a different error with the same root cause!

 

 

Leave a Reply