Magento Forum

   
adding custom mysql inside preview.phtml
 
princesimon
Jr. Member
 
Total Posts:  16
Joined:  2009-03-26
 

Hi I need help with the following.

In review.phtml

just before <?php echo $this->getChildHtml('agreements') ?>

I want to add a simple sql statement that fetch a record from a custom table inside the magento database.
I just want to basically Display “Welcome Special Customer “ if the customer Record ID is found in the custom table
if not, it will display “Welcome Customer “. Anyway here is the code that I have

<?php
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$connection->query("Select rec_id from order_custom WHERE id='$this->getCustomer()->getId()' ");

$data = $this->_read->$connection;

if ($data){

echo "Welcome Special Customer <br>";

} else {

echo "Welcome Customer <br>";

}
?>

Any help would be very much appreciated.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top