Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Retriving Data from database
 
partha
Jr. Member
 
Total Posts:  13
Joined:  2008-09-07
 

How can retrieve data from database using any other field other than Id?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

if the object extends Mage_Core_Model_Abstract there’s 2nd argument in ->load() method:

$user Mage::getModel('admin/user')->load('my@email.com''email');
 
Magento Community Magento Community
Magento Community
Magento Community
 
partha
Jr. Member
 
Total Posts:  13
Joined:  2008-09-07
 

If I like to use AND,OR like logical operators then what should I do?. Means if there is multiple condition for fetching data.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

In that case you’ll need to use collections, simple example using Zend_Db_Select object:

$collection Mage::getModel('admin/user')->getCollection();
$collection->getSelect()->where("email='a@b.com' and password='blah'");
foreach (
$collection as $item{
//...
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
mixwiz
Member
 
Total Posts:  39
Joined:  2008-07-21
 

Would this be what I need to show what the customer has ordered in the “ship to” column on the admin/orders page? I have posted more detail here but still hoping for someone help

http://www.magentocommerce.com/boards/viewthread/18051/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top