sortbydate.js 768 Bytes
var mysql = require('mysql');
var near_show_list = [];
var connection = mysql.createConnection({
    "host": "culturegallery.cm2bwcuyukrm.us-east-1.rds.amazonaws.com",
    "user": "root",
    "password": "dldbwp1207",
    "port": "3306",
    "database": "showdata"
});

connection.connect();

// 데이터 길이 파악 //
var dataNum=0;
connection.query('SELECT COUNT (*) AS cnt FROM SHOW_DATA', function (error, results, field) {
    if (error) {
        console.log(error);
    }
    dataNum = results[0].cnt;
    console.log(dataNum);
});

connection.query('SELECT start_day FROM SHOW_DATA WHERE start_day>=2021/01/01 ORDER BY start_day',function(error,results,field){
   if(error){
        console.log(error);
    }
    console.log(results);
})

connection.end();