Sunday, 28 July 2019
Wednesday, 10 July 2019
How do I set and get a cookie with jQuery?
<script type='text/javascript'>
function setCookie(key, value) {
var expires = new Date();
expires.setTime(expires.getTime() + (1 * 24 * 60 * 60 * 1000));
document.cookie = key + '=' + value + ';expires=' + expires.toUTCString();
}
setCookie('Name','Kishan');
function getCookie(key) {
var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)');
return keyValue ? keyValue[2] : null;
}
getCookie('Name');
// Output: "Kishan"
</script>
function setCookie(key, value) {
var expires = new Date();
expires.setTime(expires.getTime() + (1 * 24 * 60 * 60 * 1000));
document.cookie = key + '=' + value + ';expires=' + expires.toUTCString();
}
setCookie('Name','Kishan');
function getCookie(key) {
var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)');
return keyValue ? keyValue[2] : null;
}
getCookie('Name');
// Output: "Kishan"
</script>
Friday, 5 July 2019
Wednesday, 3 July 2019
How to import an SQL file using the command line in MySQL?
#Step1: Create just databse in your phpMyAdmin
Ex: test_table.sql
#Step2: put sql databse file in bin folder
Ex: E:\wamp64\bin\mysql\mysql5.7.26\bin\DB\test_table.sql
# Open CMD
# Step3: Change the directory folder current directory to mysql bin directory.
C:\Users\kishanvk>CD E:\wamp64\bin\mysql\mysql5.7.26\bin ↲
C:\Users\kishanvk>E: ↲
E:\wamp64\bin\mysql\mysql5.7.26\bin>
# Step4: write below command line and in this cmd
E:\wamp64\bin\mysql\mysql5.7.26\bin>mysql -u [Username] -p [DBNAME] < DB\[DBNAME.sql] ↲
Ex: E:\wamp64\bin\mysql\mysql5.7.26\bin>mysql -u root -p test_table < DB\test_table.sql ↲
# Step5: Enter password
Enter password:***** ↲
# Step6: You can see imported database in your phpMyAdmin
Subscribe to:
Posts (Atom)