Monday, November 5, 2012

Fwd: Find Command nice example

find public_html/ \( -name "*.php" \) -type f -print0 | xargs -0 grep --binary-files=without-match -ir "base64_decode\s*("

Sunday, December 4, 2011

How to add enum filed in mysql

How to add enum filed in mysql

Example:

ALTER TABLE `mycontent` ADD `returnstatus` ENUM( 'TRUE', 'FALSE' ) NOT NULL DEFAULT 'FALSE'

Tuesday, November 22, 2011

Mysql if null Example

SELECT IFNULL(parent_id, 0) AS pid, COUN T(IFNULL(parent_id, 0)) AS ans_count FROM qa GROUP BY IFNULL(parent_id, 0)

Monday, November 21, 2011

Jquery plugin

http://www.sastgroup.com/jquery/240-plugins-jquery

Wednesday, November 16, 2011

Find move the files in Linux

Find move the file types Linux

find -name "*.jpg" exec mv {} images \;

MYSQl DATE ADD Nice Example

INSERT INTO `DB`.`tbl` (`id`, `filed1`, `filed2`, `filed2`, `start_date`, `expiry_date`, `status1`, `status2`, `status3`) VALUES (NULL, '2', '33', '8', NOW(), DATE_ADD(NOW(),INTERVAL 7 DAY), 'XXXX', 'Active', 'Active');

Tuesday, November 15, 2011

Very Important Date & time Diff queries in mysql

SELECT TIME_TO_SEC(TIMEDIFF('2007-01-09 10:24:46','2007-01-09 10:23:46'));

SELECT CONCAT(
FLOOR(HOUR(TIMEDIFF(MC.expiry_date,MC.start_date)) / 24), ' days ',
MOD(HOUR(TIMEDIFF(MC.expiry_date,MC.start_date)), 24), ' hours ',
MINUTE(TIMEDIFF(MC.expiry_date,MC.start_date)), ' minutes') as