尝试更新数据库中的客户端状态时出错

时间:2019-07-06 06:19:07

标签: php

我正在尝试在对象方法中发送一些参数,但是我遇到了无法解决的错误。注意:该错误会在转到该方法之前发生。

<table class="table table-hover table-striped">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>Choose Product</th>
                    <th>Product Name</th>
                    <th>Product Price</th>
                    <th>Action</th>
                </tr>
            </thead>
            <tbody>
                <%
                String Host = "jdbc:mysql://localhost:3306/shopbilling";
                Connection connection = null;
                Statement statement = null;
                ResultSet rs = null;
                Class.forName("com.mysql.jdbc.Driver");
                connection = DriverManager.getConnection(Host, "root", "");
                statement = connection.createStatement();
                String query = request.getParameter("q");
                String data;
                if(query != null)
                {
                data = "select * from products_tbl where product_name like '%"+query+"%' or product_price like '%"+query+"%'";
                }
                else 
                {
                data = "select * from products_tbl";
                }
                rs = statement.executeQuery(data);
                while (rs.next()) {
                %>
                <tr>
                    <td><%=rs.getString("id")%></td>
                    <td> <input type="checkbox" /> </td>
                    <td><%=rs.getString("product_name")%></td>
                    <td><%=rs.getString("product_price")%></td>
                    <td class="text-center" width="250">
                       <a href='edit.jsp?u=<%=rs.getString("id")%>' class="btn btn-warning">Edit</a>
                        <a href='delete.jsp?d=<%=rs.getString("id")%>' class="btn btn-danger">Delete</a>
                    </td>
                </tr>

                <%
                }
                %>
            </tbody>

        </table>
       <a href='order.jsp' class="btn btn-success">Order</a>
  

致命错误:未捕获错误:调用成员函数   atualizarFatura()在字符串中   /srv/http/application/application/financeiro_atualizar.php:50堆栈   跟踪:抛出#0 {main}   /srv/http/application/application/financeiro_atualizar.php,第50行

0 个答案:

没有答案