2021年4月1日星期四

Pagination with Node.js and MySQL

can someone help me to do a pagination? I am using node.js and mysql, and I have not found a material to help me, when I search I only find material for MongoDB. I am trying to make a page for a CRUD, but I can't find the way to do it. I have a little idea on the server side, but I have absolutely no idea how to implement it in the buttons on the client side. Thanks a lot! This is a fragment of my code where i consult all users to display them, this fragment is in a controller.

controller.list = function(req, res, next) {      req.getConnection((err, conn) => {          conn.query('SELECT * FROM usuarios', (err, usuario) => {               if(err) {                  res.json(err);              }              if(req.session.loggedin) {                  res.render('usuarios', {                      data: usuario,                      login: true,                      nombre: req.session.nombre                  });              }else{                  return res.redirect('/admin');              }          });      });  };    
https://stackoverflow.com/questions/66913226/pagination-with-node-js-and-mysql April 02, 2021 at 08:50AM

没有评论:

发表评论