Thread: mysql saving error

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 mysql saving error 
    Registered Member
    rmb7's Avatar
    Join Date
    Nov 2008
    Posts
    1,023
    Thanks given
    2
    Thanks received
    12
    Rep Power
    200
    Look this is the problem. Any ideas on how to fix?

    Code:
    MySQL ErrorUPDATE `players` SET absX = 2966, absY = 3379, height = 0, rights =
    3, password = ryanmb WHERE playerid=8;
    java.sql.SQLException Unknown column 'ryanmb' in 'field list'
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java2928)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java1571)
            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java1666)
            at com.mysql.jdbc.Connection.execSQL(Connection.java2988)
            at com.mysql.jdbc.Statement.executeUpdate(Statement.java935)
            at com.mysql.jdbc.Statement.executeUpdate(Statement.java873)
            at server.model.players.PlayerSave.query(PlayerSave.java28)
            at server.model.players.PlayerSave.saveGame(PlayerSave.java246)
            at server.model.players.PlayerHandler.process(PlayerHandler.java124)
            at server.Server.main(Server.java24)
    Game saved for player Rmb938
    ClientHandler Client Rmb938 disconnected.
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jan 2007
    Posts
    260
    Thanks given
    3
    Thanks received
    5
    Rep Power
    0
    What do you have your password field set to in your mySQL database?
    Reply With Quote  
     

  3. #3  
    Registered Member
    rmb7's Avatar
    Join Date
    Nov 2008
    Posts
    1,023
    Thanks given
    2
    Thanks received
    12
    Rep Power
    200
    it is set as ryanmb. I am not sure what the problem is since it is just updating the row
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jan 2007
    Posts
    260
    Thanks given
    3
    Thanks received
    5
    Rep Power
    0
    Quote Originally Posted by rmb7 View Post
    it is set as ryanmb. I am not sure what the problem is since it is just updating the row
    I meant what is the row set as, like varchar, null, not null, in the database?
    Reply With Quote  
     

  5. #5  
    Registered Member
    rmb7's Avatar
    Join Date
    Nov 2008
    Posts
    1,023
    Thanks given
    2
    Thanks received
    12
    Rep Power
    200
    ohh it is set as varchar(64) not null
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Jan 2007
    Posts
    260
    Thanks given
    3
    Thanks received
    5
    Rep Power
    0
    Try setting it as a varchar(32) NOT NULL.

    If that doesn't work post back.
    Reply With Quote  
     

  7. #7  
    Registered Member
    rmb7's Avatar
    Join Date
    Nov 2008
    Posts
    1,023
    Thanks given
    2
    Thanks received
    12
    Rep Power
    200
    it was set at 32 before and I changed it to 64 seeing if that would change it and it didn't. Do you want me to post the code that it is trying to execute?
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    Jan 2007
    Posts
    260
    Thanks given
    3
    Thanks received
    5
    Rep Power
    0
    Well, try one more way.

    Code:
    varchar(32) NOT NULL default 'never logged in',
    If it doesn't work post your code.
    Reply With Quote  
     

  9. #9  
    Registered Member
    rmb7's Avatar
    Join Date
    Nov 2008
    Posts
    1,023
    Thanks given
    2
    Thanks received
    12
    Rep Power
    200
    nope that didn't work either so here is my code.

    Code:
    query("UPDATE `players` SET absX = "+p.absX+", absY = "+p.absY+", height = "+p.heightLevel+", rights = "+p.playerRights+", password = "+p.playerPass+" WHERE playerid="+playerId+";");
    Reply With Quote  
     

  10. #10  
    Banned

    Join Date
    Jan 2007
    Posts
    260
    Thanks given
    3
    Thanks received
    5
    Rep Power
    0
    Try deleting all the old information before inserting the new information.

    Your code looks fine though.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •