Hi guys well what I want to do is that when a button is pressed it increases the value in one of my database cells. So my question is how do I do this? As I cannot get this to work.

My code so far:

Any help would be appreciated

String updateStr = "UPDATE VIDEOS PLAYCOUNT = " + PLAYCOUNT + 1 + " WHERE ID = '" + id + "'";
        System.out.println(updateStr);
        try {
            stmt.executeUpdate(updateStr);
        } catch (Exception e) {
            System.out.println(e);
        }

String updateStr = "UPDATE VIDEOS PLAYCOUNT = " + PLAYCOUNT + 1 + " WHERE ID = '" + id + "'";

There should be a "set" word after update videos i.e.
"Update videos set playcount = " + ..... an so on .
Check out the syntax

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.