Html 无法将数据从my nodejs(在mysql上使用select*query后)呈现到ejs页面

Html 无法将数据从my nodejs(在mysql上使用select*query后)呈现到ejs页面,html,mysql,node.js,express,ejs,Html,Mysql,Node.js,Express,Ejs,我从mysql数据库中获取了结果,我正在控制台中获取数据,但它不会呈现在我的ejs页面中。 这是我的.ejs页面代码: <table> <tr> <th>Name</th> <th>Date Formed</th> <th>Location</th> </tr> <%for(int i = 0;i < Allo.length; i++){%>

我从mysql数据库中获取了结果,我正在控制台中获取数据,但它不会呈现在我的ejs页面中。 这是我的.ejs页面代码:

<table>
<tr>
  <th>Name</th>
  <th>Date Formed</th>
  <th>Location</th>
</tr>

<%for(int i = 0;i < Allo.length; i++){%>
        <tr>
          <td><%=Allo.name%></td>
          <td><%=Allo.form_date%></td>
          <td><%=Allo.location%></td>
        </tr>
<%}%>

</table>

console.log(结果)工作正常。

我知道了,伙计们。使用forEach解决了这个问题

<% Allo.forEach(function(Allo){ %>
          <tr>
            <td><%=Allo.name%></td>
            <td><%=Allo.form_date%></td>
            <td><%=Allo.location%></td>
          </tr>
  <% })%>

<% Allo.forEach(function(Allo){ %>
          <tr>
            <td><%=Allo.name%></td>
            <td><%=Allo.form_date%></td>
            <td><%=Allo.location%></td>
          </tr>
  <% })%>