0

How can I store data from a web page running on a local server to a mysql database using express /nodejs

Web development

9th Mar 2020, 1:49 PM
R_N
4 Answers
+ 1
install dependency that you need, last time i work with mysql i was using sequelize. but if you're only using mysql try mysql2 https://www.npmjs.com/package/mysql2
9th Mar 2020, 2:04 PM
Taste
Taste - avatar
0
I want To store data (checked radio button) from local web page into mysql database
9th Mar 2020, 2:22 PM
R_N
0
setup post route in your express to recieve and save the data. in the html create a form with action directing into that route you just created. in node app.post('/theRoute',(request, response)=>{ //process and save the data hete }) in html <form action='http://urlhere/theRoute' method='post'> there's some other basic step like body-parser, not sure if i can put it all here. Gordon do you have good resource explaining this topic ?
9th Mar 2020, 2:32 PM
Taste
Taste - avatar
0
if you're using express, then yes
9th Mar 2020, 7:59 PM
Taste
Taste - avatar