How can I store data from a web page running on a local server to a mysql database using express /nodejs | SoloLearn: Learn to code for FREE!

0

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

Web development

3/9/2020 1:49:40 PM

R_N

4 Answers

New Answer

+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

0

I want To store data (checked radio button) from local web page into mysql database

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 ?

0

if you're using express, then yes