代码之家  ›  专栏  ›  技术社区  ›  andrew

MySQL错误5154:占位符无效(Node.js XDevAPI Connector)

  •  0
  • andrew  · 技术社区  · 8 年前

    我目前正在使用一个MySQL服务器(版本8.0.12),并通过支持XDevAPI和NoSQL的官方Node.js MySQL连接器连接到它。我正试图从数据库中提取一些博客文章,但收到错误5154。

    这是我的代码:

    // Data used
    const postsPerPage: number;
    const start: number;
    
    let results: BlogPost[] = [];
    
    await blogPosts
        .find('accountID = :accountID')
        .bind('accountID', req.account.id)
        .sort('posted ASC')
        .limit(postsPerPage + 1)
        .offset(start)
        .execute(post => {
            results.push(post);
        });
    
    1 回复  |  直到 8 年前
        1
  •  0
  •   andrew    8 年前

    结果发现 req.account.id 实际上在这一点上还没有定义。我的输入数据有点乱

    推荐文章