Why does this say "NO such Column?"

  • SELECT * FROM XXXXX WHERE Player_user = GetPlayer


    db.executeUpdate("INSERT INTO `XXXXX` (Player_user,PLayer_money) VALUES (GetPlayer, 2000);");



    (GetPLayer is String GetPlayer = p.getName();)



    Caused by: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such column: GetPlayer)
    at org.sqlite.DB.newSQLException(DB.java:383)
    at org.sqlite.DB.newSQLException(DB.java:387)
    at org.sqlite.DB.throwex(DB.java:374)
    at org.sqlite.NativeDB.prepare(Native Method)
    at org.sqlite.DB.prepare(DB.java:123)
    at org.sqlite.Stmt.executeQuery(Stmt.java:121)
    at pluginapi.objects.SQLiteDatabaseAPI.executeQuery(SourceFile:57)
    at EffNet.EffNet.onConnect(EffNet.java:68)
    ... 8 more

  • As it has been pointed out in your other topic, you have to put strings into single quotes (INSERT INTO `XXXXX` (Player_user, Player_money) VALUES ('GetPlayer', 2000);), or if "GetPlayer" is a variable, you have to use string concatenation (INSERT INTO `XXXXX` (Player_user, Player_money) VALUES ('" + GetPlayer + "', 2000);)

  • But that's no reason to create multiple topics about the same issue. If you have created a topic, please stick to that topic when you want to post anything that's related to your topic.


    In this case, please post your full code.

  • and I did reply to my old topic and no one answered

  • Seriously Captain? If nobody responds to your other post then wait longer or bump the topic. This is basic forum etiquette. Creating multiple identical topics is spamming. Nobody should have to explain this to you.


    And welcome to the world of programming. We all get frustrated when things dont work out as we hope. Solutions are not always straightforward. I am glad to see you trying but whining and pouting when something doesn't work only reveals your attitude towards learning. We've had lengthy arguments on this topic several months ago in another thread where you ended the discussion by adding "i already know basic java" to your signature. You aren't fooling anyone. Again, I am glad to see you trying but please try to control your frustration. Patience and perseverence are necessary attributes to be a programmer.

  • 68. String query = "SELECT * FROM EffNet WHERE Player_user = GetPlayer";

    As mentioned, you have to use single quotes, and if it's a variable, you have to use string concatenation: String query = "SELECT * FROM EffNet WHERE Player_user = '" + GetPlayer + "';


    and I did reply to my old topic and no one answered

    Your latest post was >>the above code SHOULD work and update the record<<, how is this a question? Apparently you edited your initial post (you removed your original text and replaced it by a new question), you should never do that, since that makes all replies in your topic pointless (and, in addition, no one will see your question) :!: If you have a new question (which is related to the topic), post it in a new response.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!