Đó dữ liệu vào combobox trong php
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding. Bạn đang xem: Load dữ liệu lên combobox trong php Đây là các bảng csdl của mình :Company(ComName,ComCode....)Employee(EmpCode,FisrtName,LastName,ComCode..) yêu cầu đưa csdl lên CompanyName rồi hiển thị dũ liệu EmployeeName theo CompanyName như hình sau: mình có viết đoạn code mà không đưa csdl len được cbo box companyName trong JSP được .mong các bạn giúp mình.Đây là code : public List getComNameOT(ListCompanyOT listCompanyOT) { List listCompanyOTs =
null; ListCompanyOT listOT = null; Connection con = ConnectionDB.getDBConnection(); String sql="SELECT COM_NAME FROM COMPANY_MTS"; try { PreparedStatement pst = con.prepareStatement(sql); ResultSet rs = pst.executeQuery(); listCompanyOTs = new ArrayList(); while (rs.next()) { listOT = new ListCompanyOT(); listOT.setComName(rs.getString("COM_NAME")); listCompanyOTs.add(listOT); } } catch (SQLException e) { e.printStackTrace(); } return listCompanyOTs; } Reactions:v2tien Xem thêm: Review Lăn Khử Mùi Vichy Triệt Mùi Hôi Hiệu Quả Nhất, Review Giá Bao Nhiêu Để
trong thẻ code nhé bạn, còn phần trang jsp bạn chưa đưa lên sao biết được mà xem
|