roguecoder
roguecoder

Reputation: 187

Zend_Db_Select help with join

i'm using the following code and get the following error

$select = $model->select();
$select->from(array('stocktakejob'), 
            array("ProductID" => "stocktakejob.ProductID",
                    "TotalCount" => "SUM(stocktakejob.NewCount)"
              )
       )->join(array('products'),
               'products.ProductID = stocktakejob.ProductID', 
               array("ProductCode" => "products.ProductCode")
       )->where("stocktakejob.StockTakeID = ".$stocktake->getStockTakeID())
       ->group('stocktakejob.ProductID');

error: Exception

Select query cannot join with another table

Is there something i'm missing ? anyhelp would be appreciated.

Upvotes: 0

Views: 158

Answers (1)

Marcin
Marcin

Reputation: 238081

I think that you should set integrity check to false when making join statements:

$select->setIntegrityCheck(false);

Upvotes: 3

Related Questions