Journal

Journal

Those who need it to accomplish some task or goal.

How to run custom MySql query in Magento ?

$db = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’);
$result=$db->query(“SELECT * FROM PCDSTable”);


$connect = Mage::getSingleton('core/resource')->getConnection('core_read');
$result=$db->query(“SELECT id FROM `customer_wishlists` WHERE `type`='wishlist'");

array_map function

The array_map() function sends each value of an array to a user-made function, and returns an array with new values, given by the user-made function.

Example:

function myfunction($num)

Error's and solution's