Hi all,

This is my first post and I'm new to Zend Framework. I'm using 1.9.0.

I'm doing this:

-------

$db = Zend_Registry::get('dbAdapter');
$db->setFetchMode(Zend_Db::FETCH_OBJ);
        
$select = new Zend_Db_Select($db);
$select->from(array('p' => 'jos_vm_product'),array( 'product_sku'))
          ->join(array('pl' => 'jos_vm_product_price'),'p.product_id =
pl.product_id','product_price')
          ->where('p.bloom_calc = "y"');
                        
$sql = $select->__toString(); // Just to now whats happening
$stmt = $db->query($select);
$productlist = $stmt->fetchAll();

---------

This works just fine locally. On the server it returns the right number of
rows but all the values are null!? 

product_sku = null
product_price = null

This is the SQL that is generated:
SELECT `p`.`product_sku`, `pl`.`product_price` FROM `jos_vm_product` AS `p`
 INNER JOIN `jos_vm_product_price` AS `pl` ON p.product_id = pl.product_id
WHERE (p.bloom_calc = "y")

When I run this using phpMyAdmin (on the server) it returns the right
result. It's driving me crazy. Any ideas?

Regards Morgan

-- 
View this message in context: 
http://www.nabble.com/Select-with-Join-gives-null-values-tp24889890p24889890.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to