1
3 개의 테이블을 조인하기 위해 zend_db_select를 사용했으며 별칭이있는 열 이름을 볼 때까지 결과 집합 배열에서 별칭이없는 키가있는 배열을 반환합니다.zend db join resultset
$dbSelect = $db->select()->from(array("pp"=>"products_photos"),array())
->joinInner(array("ph"=>"photos"), "pp.photo_id=ph.photo_id","ph.photo_id")
->joinInner(array('pr'=>'products'),"pr.product_id=pp.product_id","pr.product_id")
->where("pr.product_id=$row->product_id");
$photoJoinRowSet = $db->fetchAll($dbSelect);
var_dump($photoJoinRowSet);die();
결과 LIKE :
array(2) { [0]=> array(3) { ["product_id"]=> string(1) "1" ["photo_id"]=> string(1) "4" }}
내가 기대 동안 : 열 별칭을 가진 array(2) { [0]=> array(3) { ["pr.product_id"]=> string(1) "1" ["ph.photo_id"]=> string(1) "4" }}
...... 즉.
왜 이런 일이 발생하는지 알고 있습니까? 감사.
감사합니다. 젠드 문서는 명확하게 진술하지 않았지만 – krishna
나는이 점에 대해 당신을 비난 할 수 없다. :) – Benjamin