Use nodejs to update the table of mysql, the parameters after SET are not fixed, how to achieve?

I want to write an interface to update user information,

UPDATE user_information SET the parameters here are not fixed where uid =?

could be name=? or name=?, sex=? or name=?, sex=?, qq=?

Please how should I achieve it?

app.all("/information/update", (req, res, next) => {
    let sess = req.session;
    let result = {
        code: "0000",
        data: {},
        message: "fail",
        detail: "",
        function: "prize",
        number: 0
    };
    let params = req.body;

    let selectSql = "select name from user_information where uid = ?";
    let updateSql = "UPDATE user_information SET name=? where uid = ?";



    let name = helper.stringTrim(params.name) || "";

    if(sess.loginUserInfo === undefined) {
        result["detail"] = "";
        res.send(JSON.stringify(result));
    } else {
        let loginInformation = sess.loginUserInfo;
        // console.log("loginInformation == ", loginInformation);
        pool.getConnection((err, connection) => {
            connection.query(
                selectSql,
                [loginInformation.uid],
                (err, rows) => {
                    // console.log("rows ==", rows);
                    if(rows.length === 1) {
                        result["detail"] = "";
                        connection.query(
                            updateSql,
                            [name, loginInformation.uid],
                            (err, rows) => {
                                if(err) {
                                    result["detail"] = "";
                                    res.send(JSON.stringify(result));
                                } else {
                                    result["detail"] = "0001";
                                    result["message"] = "success";
                                    result["detail"] = "";
                                    res.send(JSON.stringify(result));
                                }

                            }
                        );

                    } else {
                        result["detail"] = "";
                        res.send(JSON.stringify(result));
                    }

                }
            );
            pool.releaseConnection(connection);
        })
    }
});
Jun.09,2022

spell strings dynamically

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36b1d-41075.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36b1d-41075.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?