I have a function in Java that is meant to update the description field and the title field of a table in a mysql database that looks like this:
public void updateDescription( String desc, String title, int urlid ) throws SQLException, IOException {
String cutDesc = desc.substring(0, 99);
Statement stat = connection.createStatement();
String query = "UPDATE urls SET description = '"+cutDesc+"', title = '"+title+"' WHERE urlid =" + urlid;
stat.executeUpdate( query );
stat.close();
}
When this function is called with:
updateDescription(desc, title, urlID);
Nothing is put into the table. There are no errors, it just seems to ignore it. Any ideas what is wrong here?
Thanks
wherecondition did not fetch any records.