Cita:
ControllerMessage: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Array' in 'on clause'
Código PHP:
public function carritoAction()
{
$auth=Zend_Auth::getInstance();
if($auth->hasIdentity()){
$this->_helper->viewRenderer->setRender();
$this->_helper->layout()->enableLayout();
$username = $auth->getIdentity()->username;
$ses = new Zend_Session_Namespace($username);
$compra=count($ses->compra);
echo $compra.'<br>';
$prod= new Application_Model_Prod();
for($i=0; $i<=$compra; $i++){
$prodInfo[]=$prod->info($ses->compra[$i]);
echo $prodInfo[$i]['nom'];
// print_r($prodInfo);
// echo $ses->compra[$i].'<br>';
}
//$this->view->q=$prodInfo;
}else{}
}
Código PHP:
public function info($pid){
$dbAdapter = Zend_Db_Table::getDefaultAdapter();
$select=$dbAdapter->select()
->from(array('a'=>'pos_prod'), array('nom'))
->join(array('b'=>'pos_prc'), array('prc'))
->where('a.pid = ?', $pid)
->where('b.pid = ?', $pid);
$q=$select->query();
$row=$q->fetchAll();
return $row;
}
salu2