DEV Community

loizenai
loizenai

Posted on

NodeJS/Express – POST/GET form data to MySQL using Sequelize ORM – Ajax JQuery

https://grokonez.com/node-js/nodejs-express-save-form-data-to-mysql-using-sequelize-orm-ajax-jquery-bootstrap-view

NodeJS/Express – POST/GET form data to MySQL using Sequelize ORM – Ajax JQuery + Bootstrap view example

In the tutorial, we show how to save form data to MySQL in NodeJS/Express application using Sequelize ORM with Ajax JQuery & Bootstrap view.

Related posts:

Overview

Goal

Technologies

  • NodeJS/Express
  • Sequelize ORM
  • MySQL
  • JQuery Ajax
  • Bootstrap

We create a NodeJS/Express project as below structure:


/NodeJS-Express-Ajax-JQuery-Bootstrap-MySQL
    /app
        /config
            db.config.js
            env.js
        /controllers
            user.controller.js
        /models
            user.model.js
        /routes
            user.route.js
    /node_modules
    /resources
        /static
            /js
                getrequest.js
                postrequest.js
    /views
        404.html
        index.html
    package.json
    server.js

Run above project then makes Post/Get requests, results:

-> Bootstrap view:

NodeJS-Express-save-form-data-to-MySQL-with-Ajax-JQuery-Bootstrap-view-results

-> MySQL's table:

NodeJS-Express-save-form-data-to-MySQL-with-Ajax-JQuery-Bootstrap-view-database-tables

Demo

Practice

Setting up NodeJS/Express project

Create a folder: 'NodeJS-Express-Ajax-JQuery-Bootstrap-MySQL':


mkdir NodeJS-Express-Ajax-JQuery-Bootstrap-MySQL
cd NodeJS-Express-Ajax-JQuery-Bootstrap-MySQL

Then init NodeJS project, see prompts:

More at:

https://grokonez.com/node-js/nodejs-express-save-form-data-to-mysql-using-sequelize-orm-ajax-jquery-bootstrap-view

NodeJS/Express – POST/GET form data to MySQL using Sequelize ORM – Ajax JQuery + Bootstrap view example

Neon image

Set up a Neon project in seconds and connect from a Node.js application

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Get started →

Top comments (0)

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

Dive into this insightful write-up, celebrated within the collaborative DEV Community. Developers at any stage are invited to contribute and elevate our shared skills.

A simple "thank you" can boost someone’s spirits—leave your kudos in the comments!

On DEV, exchanging ideas fuels progress and deepens our connections. If this post helped you, a brief note of thanks goes a long way.

Okay