change from mysql to mysql2

This commit is contained in:
Mystikfluu
2023-02-06 13:27:02 +01:00
parent cbfd1404f8
commit 4f39af2749
5 changed files with 138 additions and 61 deletions
+1 -6
View File
@@ -160,12 +160,7 @@ export const setup = function (router, con, server) {
}
}
let sql = `
START TRANSACTION;
insert into ipost.posts (post_user_name,post_text,post_time,post_receiver_name,post_from_bot,post_reply_id,file_0,file_1,file_2,file_3,file_4) values (?,?,?,?,?,?,?,?,?,?,?);
SELECT LAST_INSERT_ID() as ID;
COMMIT;
`;
let sql = `START TRANSACTION;INSERT INTO ipost.posts (post_user_name,post_text,post_time,post_receiver_name,post_from_bot,post_reply_id,file_0,file_1,file_2,file_3,file_4) VALUES (?,?,?,?,?,?,?,?,?,?,?);SELECT LAST_INSERT_ID() as ID;COMMIT;`;
let values = [encodeURIComponent(res.locals.username), message, Date.now(), receiver, res.locals.isbot, reply_id,...file_names];
con.query(sql, values, function (err, result) {
if (err){