From f1e66fb2ddd46bf3d5906f53068b28599d97f61d Mon Sep 17 00:00:00 2001 From: Qing Date: Mon, 10 Jul 2023 23:58:11 +0800 Subject: [PATCH] =?UTF-8?q?Bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/hellogithub/dao/AdminDao.java | 4 ++-- src/com/hellogithub/dao/commentDao.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/hellogithub/dao/AdminDao.java b/src/com/hellogithub/dao/AdminDao.java index 75ff663..9ddec83 100644 --- a/src/com/hellogithub/dao/AdminDao.java +++ b/src/com/hellogithub/dao/AdminDao.java @@ -215,7 +215,7 @@ public class AdminDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql="UPDATE category SET isValid = ? WHERE userId = ?"; + String sql="UPDATE category SET isValid = ? WHERE categoryId = ?"; num = runner.update(conn, sql, isvalid,id); conn.close(); } catch (SQLException e) { @@ -230,7 +230,7 @@ public class AdminDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql="UPDATE article SET isValid = ? WHERE userId = ?"; + String sql="UPDATE article SET isValid = ? WHERE articleId = ?"; num = runner.update(conn, sql, isvalid,id); conn.close(); } catch (SQLException e) { diff --git a/src/com/hellogithub/dao/commentDao.java b/src/com/hellogithub/dao/commentDao.java index 65c295b..104dc4a 100644 --- a/src/com/hellogithub/dao/commentDao.java +++ b/src/com/hellogithub/dao/commentDao.java @@ -129,7 +129,7 @@ public class commentDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql="update comment set userId = ? , projectId = ? , content = ? ,isUsed =?, commentTime=?, isValid=?,star=?,likeNum=?where commentId =? "; + String sql="update comment set userId = ? , projectId = ? , content = ? ,isUsed =?, commentTime=?, isValid=?,star=?,likeNum=? where commentId =? "; num = runner.update(conn,sql,userId, projectId , content , isUsed, commentTime, isValid, star, likeNum ,commentId); conn.close(); } catch (SQLException e) {