Jump to content

Unknown column 'Accessoires' in 'where clause' ??????


Recommended Posts

public int rechercheParCat(String test) {
        int idcat = 0;
        try {
            String query = "SELECT id_cat FROM categorie WHERE titre="+test;
            PreparedStatement pst = cnx2.prepareStatement(query);
//            pst.setString(1, test);
            ResultSet rs = pst.executeQuery(query);
            idcat = rs.getInt(1);
        } catch (SQLException ex) {
            System.err.println(ex.getMessage());
        }

        return idcat;
    }

}

i have this erreur while i have Accessoires in table categorieas u can see in the pictures 

help me please

output:

0
Unknown column 'Accessoires' in 'where clause'

 

1.PNG

2.PNG

3.PNG

4.PNG

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...