The question I have is in the images, which provides code for the process Im working on. Using Node Is, I would like to be
The question I have is in the images, which provides code for the process Im working on.
Using Node Is, I would like to be able to update fields in MySQL Database. To load data into a table with editable fields, I would call upon a function to queue the data in a file called get_faq.js: var mysql = require('mysql2'); var sql = require('../../settings.js'): const connection = mysql.createConnection(sql): exports.getAll-function(data) { connection.query SELECT * FROM faq_sections, function(err, headers, fields) ifferr) datal error: err}); }else{ connection.query 'SELECT * FROM faq WHERE sectionId=1'. function(err, general, fields) { if(er){ data(error: err}); else connection.query "SELECT * FROM faq WHERE section Id=2', function(err, forfamilies, fields) if(err) { data(error: err}); else connection.query 'SELECT * FROM faq WHERE sectionId=3'. function(err, allhouses, fields) { if(err) data errorerr}); else connection.query "SELECT * FROM faq WHERE section ld , function(err, transportation, fields) if(err) { data[error: err}); else connection.query 'SELECT * FROM faq WHERE sectionId=5'. function(err, neville, fields) { ifier) data( error: err}); else { /datal 'headers': headers, general': general, 'families': families, 'allhouses': allhouses, transportation': transportation, 'neville': neville) connection.query "SELECT * FROM faq WHERE section id=6. function(err, shadyside, fields) { if(er) data(error: ent}); else: connection.query "SELECT FROM faq WHERE section Id-7. function(err, universityplace, fields) if(err) data[error: err}); else { data[{"headers': headers, genera general, 'families': forfamilies, 'allhouses': allhouses, transportation': transportation, 'neville neville, 'shadyside': shadyside, 'universityplace': universityplace)); This loads the data into a page called faq.handlebars. This is achieved using this code in the index.js file: app.get('/faq', function(req,res) { GET_Faq.getAlk(function(data) { if(data.error) res.redirect(500); else { res.render('faq'. headers data.headers, general data general, allhouses : data.allhouses, forfamilies : data. families, transportation data transportation, neville : data.neville, shadyside data.shadyside, universityplace: data universityplace and is displayed like this in faq.handlebars:
For Families
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
View Solution
Step: 2
Sign Up to view
Step: 3
Sign Up to view
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance