Search This Blog

Friday, February 17, 2012

change address bar search to google

change address bar search to google
1. In Firefox type about:config in the address bar and press ENTER.

2. Locate and double-click the entry for keyword.URL

3. Set the value based on which search provider you would like to use for your address bar searches. Here are a few search strings you can use.

Yahoo: http://search.yahoo.com/search?p=

Ask: http://www.ask.com/web?q=

Bing: http://www.bing.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=

Google: http://www.google.com/search?&q=

Tuesday, February 14, 2012

mysql IN query without changing the order and maintaining the input order

mysql IN query without changing the order
e.g
SELECT FROM emp WHERE (id in ('10001', '10004','10003','10025')) ORDER BY FIELD (id,'10001', '10004','10003','10025')
this will maintain the order of 1,4,3,5
instead of the regular 1,3,4,5

Friday, February 10, 2012

Magento retrive product attribute like image

$products = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('image')
->addFieldToFilter('sku', 'mysku');
$productsName = array();
foreach($products as $p){
$productsName[] = $p->getData('image');
}
print_r($productsName);