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:

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

Tags: magentotable nametable prefix