title: OR sql query doesnt work in java system-searching for data in column
body: <p>I have a java class that is supposed to display a table. So i want to search FROM table called Film the filmtitle and the film genre but the OR query doesn't work? any idea how to fix this?</p>
  
  <p>heres my code btw</p>
  
  <pre><code>public void searchbyTitle()
  {
      String sql = "SELECT filmtitle, filmyear, filmgenre, companyname FROM production, film, 
  company  WHERE LOWER(filmtitle) like LOWER
   (?) OR LOWER(filmgenre) like LOWER (?) and production.companyid = company.companyid AND production.filmid = film.filmid";
      con = DBConnect.getConnection();
  
      try
      {
          PreparedStatement pst = con.prepareStatement(sql);
          pst.setString(1, "%" +txtSearch.getText()+"%");
          ResultSet rs = pst.executeQuery();
          table.setModel(DbUtils.resultSetToTableModel(rs));
  
      }catch(SQLException e)
      {
          e.printStackTrace();
      }
  
  
  }
  </code></pre>
  
  <p>it only works if i remove the or,but i also want to be able to search for film genre
  LOWER is also what i used so that it will be case insensitive also used postgresql..any help is appreciated</p>