diff --git a/framework/core/src/Post/Post.php b/framework/core/src/Post/Post.php index 65c18c6ee..b07dc989d 100644 --- a/framework/core/src/Post/Post.php +++ b/framework/core/src/Post/Post.php @@ -99,7 +99,7 @@ class Post extends AbstractModel $post->number = new Expression('('.$db ->table('posts', 'pn') ->whereRaw('pn.discussion_id = '.intval($post->discussion_id)) - ->select($db->raw('max(pn.number) + 1')) + ->select($db->raw('max('. $db->getTablePrefix() .'pn.number) + 1')) ->toSql() .')'); });