Nishtha Thakur has Published 564 Articles

How can we export data to a CSV file whose filename name contains timestamp at which the file is created?

Nishtha Thakur

Nishtha Thakur

Updated on 07-Feb-2020 05:42:46

443 Views

Sometimes we need to export data into a CSV file whose name has a timestamp at which that file is created. It can be done with the help of MySQL prepared statement. To illustrate it we are using the following example −ExampleThe queries in the following example will export the ... Read More

How can we force MySQL out of TRADITIONAL mode?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jan-2020 07:09:18

75 Views

With the help of the following command we can force MySQL out of TRADITIONAL mode −mysql> Set SQL_MODE =''; Query OK, 0 rows affected (0.00 sec)

What MySQL returns if specified format string is not as per accordance with the date string passed as arguments to STR_TO_DATE() function?

Nishtha Thakur

Nishtha Thakur

Updated on 30-Jan-2020 06:20:30

380 Views

If the specified format string and date string did not match then MySQL will return NULL value as output along with a warning. Following is an example to understand the same −mysql> Select STR_TO_DATE('20172810', '%Y, %d%m'); +------------------------------------+ | STR_TO_DATE('20172810', '%Y, %d%m') | +------------------------------------+ | NULL           ... Read More

Create a text inside circles in HTML5 Canvas

Nishtha Thakur

Nishtha Thakur

Updated on 29-Jan-2020 10:52:50

804 Views

To create a text inside circles in canvas, use the:context.beginPath();The following is the canvas:$("#demo").on("click", "#canvas1", function(event) {    var canvas = document.getElementById('canvas1');    if (canvas.getContext) {       var context = canvas.getContext("2d");       var w = 25;       var x = event.pageX;       ... Read More

How to detect a particular feature through JavaScript with HTML

Nishtha Thakur

Nishtha Thakur

Updated on 29-Jan-2020 08:37:27

125 Views

Use Modernizr in HTML to detect a feature like audio through JavaScript:if (Modernizr.audio) {    /* properties for browsers that    support audio */ } else{    /* properties for browsers that    does not support audio */ }

How to create multi-column layout in HTML5 using tables?

Nishtha Thakur

Nishtha Thakur

Updated on 29-Jan-2020 08:09:25

762 Views

Design your webpage to put your web content on multiple pages. You can keep your content in the middle column, you can use left column to use menu, and right column can be used to put an advertisement or some other stuff.Example           Three Column ... Read More

Apply gravity between two or more objects in HTML5 Canvas

Nishtha Thakur

Nishtha Thakur

Updated on 29-Jan-2020 06:41:21

163 Views

To apply gravity between two or more object in Canvas:var distX = ob1.x - ob2.x, distY = ob1.y - ob2.y; var val = distX *distX + distY * distY; var r = Math.sqrt(val); var F = 50 / val; var rhat_x = distX / r; var rhat_y = ... Read More

Frame by frame animation in HTML5 with canvas

Nishtha Thakur

Nishtha Thakur

Updated on 29-Jan-2020 06:36:50

620 Views

To create a frame by frame animation in HTML5 with canvas, try to run the following code:var myImageNum = 1; var lastImage = 5; var context = canvas.getContext('2d'); var img = new Image; img.onload = function(){    context.clearRect( 0, 0, context.canvas.width, context.canvas.height );    context.drawImage( img, 0, 0 ... Read More

How can it be possible to add 3 months interval in a MySQL date without using the word ‘Months’ with interval?

Nishtha Thakur

Nishtha Thakur

Updated on 29-Jan-2020 06:35:05

284 Views

It is possible with the help of keyword Quarter as follows −mysql> Select '2017-06-20' + INTERVAL 1 Quarter AS 'After 3 Months Interval'; +-------------------------+ | After 3 Months Interval | +-------------------------+ | 2017-09-20              | +-------------------------+ 1 row in set (0.00 sec)

How to get last day of the previous month in MySQL?

Nishtha Thakur

Nishtha Thakur

Updated on 29-Jan-2020 05:12:09

3K+ Views

With the help of following MySQL query, we can get the last day of previous month −mysql> SELECT LAST_DAY(now() - INTERVAL 1 MONTH) AS 'LAST DAY OF PREVIOUS MONTH'; +----------------------------+ | LAST DAY OF PREVIOUS MONTH | +----------------------------+ | 2017-09-30                 | +----------------------------+ 1 row in set (0.00 sec)

Advertisements