Monthly Archive: July 2017
Create daterange using function
function createDateRangeArray($strDateFrom,$strDateTo) { // takes two dates formatted as YYYY-MM-DD and creates an // inclusive array of the dates between the from and to dates. // could test validity of dates here but I’m...
How to add user in Linux
1.useradd {NAME} 2.passwd {NAME} 3.chage -d 0 {NAME} : To force user to change password when first login 4.create user home directory and chown to the user permission. EX: mkdir /home/{NAME} chown {NAME}.{NAME} /home/{NAME}...
How to dump and import sql into mysql (Command Line)
#EXPORT mysqldump -u {USER} -h {IP} -p {DB_NAME} {DB_TABLE (OPTIONAL)} | gzip > dump.sql.gz #IMPORT CREATE DATABASE {DB_NAME} mysql -u {USER} -h {IP} -p {DB_NAME} < dump.sql option:- -d : to dump only table...
How to center in html css
https://www.w3.org/Style/Examples/007/center.en.html http://vanseodesign.com/css/vertical-centering/
Lightslider js (Nice & Convinient Plugin for Slider)
http://sachinchoolur.github.io/lightslider/ ### HTML ### <div id=”image-thumbnail”> <div class=”carousel-control left” id=”left”> <i class=”fa fa-angle-left fa-3″></i> </div> <div class=”carousel-control right” id=”right”> <i class=”fa fa-angle-right fa-3″></i> </div> </div> ### Javascript ### $.ajax({ type: “POST”, url: “https:///getImages”, data:...
mysql replace character
UPDATE game SET g_game_path = REPLACE(g_game_path,”s1.g”,”um”); For the query above, is to update the “game” table , to replace g_game_path’s “s1.g” into “um”
MYSQL INSERT INTO SELECT
To select data from table a to insert into b INSERT INTO ‘DB_NAME’.’TABLE_NAME'(TABLE_FIELD) SELECT ‘FIELDS_TO_INSERT_MUST_BE_TELE_WITH_INSERT_FIELD’ FROM ‘DB_NAME’.’TABLE_NAME’ WHERE (CONDITION);