Thursday, 29 September 2011

How to automatically backup mysql database using cron?

Hi All,

Open crontab in linux server or window server and write the following line. this will backup database each mint.

$crontab -e

press enter and crontab will be opened and write following line:

* * * * * mysqldump -uroot -proot  ipay4me | gzip -9 > /var/www/archive/dbbackup/ipay4me.sql.gz


$vim /var/www/archive/dumpdatabase

Write down following lines into that file:

mysqldump -uroot -hlocalhost -proot ipay4me | gzip -9 > /var/www/archive/dbbackup/ipay4me_$(date +"%d-%m-%Y-%H-%I-%S").sql.gz
exit 0

Set crontab:

50 11 * * * /var/www/archive/dumpdatabase /usr/bin/php Asia/Calcutta >/dev/null 2>&1

This cron will run daily at 11:50 PM


Tuesday, 27 September 2011

How to import a compressed mysql file .sql.gz using linux?


Please do the following to do the same.

zcat /newsites/urdutahzeeb/ | mysql -u naughty -p urdujoom


Wednesday, 21 September 2011

How to change color on focus of input box using jquery?

Hi Dear,

<script src=""></script>
.focused {
    background: #abcdef;
<form name="focusForm" id="focusForm" method="POST" >
<table width="100%" cellspacing="2" cellpadding="2" >
        <td width="180">First Name: </td>
        <td><input type="text" name="txtFName" value="" /></td>
        <td>Last Name: </td>
        <td><input type="text" name="txtLName" value="" /></td>
        <td>Age: </td>
        <td><input type="text" name="txtAge" value="" /></td>
        <td>Occupation: </td>
        <td><input type="text" name="txtOccupation" value="" /></td>
        <td>Secret Question: </td>
        <td><input type="text" name="txtQuestion" value="" /></td>
        <td>Answer: </td>
        <td><input type="text" name="txtAnswer" value="" /></td>
//$("#focusForm input:first").focus();
//$("#focusForm :input").attr('disabled','disabled');
$("#focusForm :input").live("focus blur", function(e) {
    var el = $(this);


Tuesday, 20 September 2011

How to check all checkbox using jquery?

Hi Guys!

include jquery.js on the top of file and then write following code:

<form name="frm" id="frm" >
<input type="checkbox" name="abc[]" id="1" value="1" >Yes
<input type="checkbox" name="abc[]" id="2" value="2" >No
<input type="checkbox" name="abc[]" id="3" value="3" >None
<input type="button" name="btnCheckAll" value="Check All" onclick="checkAll();" />
function checkAll(){
$("#frm input[@name='abc'][type='checkbox']").attr('checked', true);