How to get magento collection
by next condition:
where (url_from = "1" AND url_to = "2")
OR (url_from = "2" AND url_to = "1")
Thank you!
you want something like that
$_products->addFieldToFilter('url_from', array('in' => array(1,2)));
$_products->addFieldToFilter('url_to', array('in' => array(2,1)));
url_from=1 AND url_to=1
.
WHERE ((url_from = '1') OR (url_to = '2')) AND ((url_from = '2') OR (url_to = '1'))
, which is obviously not correct
$_products->addFieldToFilter('url_from', array('in' => array(1,2))); $_products->addFieldToFilter('url_to', array('in' => array(2,1)));