How to copy one column into another in mysql

UPDATE table_name
SET `col2` = `col1`;

I used this UPDATE command in my codeigniter project, something like this-

UPDATE default_event
SET `slug` = `ename`;


Difference between echo and print in php

echo and print are both language construct in php, however print returns 1 but it is not a function.

Below mentioned usage of echo and print, both are valid

echo "Hello World"
print "Hello World"

echo("Hello World")
print("Hello World")

echo can output more than 1 string while print cannot(using comma separator)

echo "Hello", "world","I am Swapnesh";
print "Hello";
print "World";

How to send email to multiple recipients in magento

$postData['offemail'] = '';
$templateId = 1;
$recipients = Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT);
$recipients = explode(',' , $recipients);
$store = Mage::app()->getStore();
$translate = Mage::getSingleton('core/translate');
'Recipient Name',
array('data' => $postObject),

What to do when firefox consumes lot of memory

Being a developer i noticed that my firefox consumes lot of memory once it was started. Few of the points may be helpful for you to keep the memory little free –

  • Hide the bookmark and web developer toolbar as use not quite ofently using these. (try to use shortcuts for that ctrl+b for Bookmarking and F12 for web developer tool).
  • Restart your browser with add-ons disabled and check memory consumption (MENU -> HELP -> Restart with Add-ons disabled).
  • If you are heavily using the add-ons try to uninstall and remove the unnessary add-ons/plugins.
  • You can also edit “session” options in Firefox, only if you understand the technical risks.

System.out.print in php

System.out.print is totally valid in php likewise in JAVA. I ran this sample code and its working all fine in PHP 5.3.

$result = 5;
System.out.print(“This is a valid System.out.print with uppercase S”);
system.out.print(“This is a valid system.out.print with lowercase s”);

How to remove suckerfish JS error

Add this line of code to suckerfish.js file


if (document.getElementById("nav") == null) return;

It looks like —

if (document.getElementById("nav") == null) return;
var sfEls=document.getElementById("nav").getElementsByTagName("LI");
for(var i=0;i<sfEls.length;i++){
this.className+=" sfhover"}
this.className=this.className.replace(new RegExp(" sfhover\\b"),"");}