javascript - Why is date_format(?,'%d-%b-%y') failing in node? -


i'm using node scrape data , insert table

the retrieved data in form ['03-jan-14',20.18]

i have sql set this:

var sql = "insert data (data_date, data_value) values (date_format(?,\'%d-%b-%y\'),?)"; var insert_data = [parsedresults.data_date, parsedresults.data_value]; sql = mysql.format(sql, insert_data); 

when run script this

insert data (data_date, data_value) values (date_format('03-jan-14','nan-%b-%y'), 20.18) 

i've done google searching , can't find reason this.

it seems though javascript interpreting %d rather passing is.

would love insight on problem.

not looking work-arounds, want know why failing in particular way.

waking thread... deal %d in javascript strings, must double it: '%%d-%b%y'.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -