MySQL Table Problem

This sorta goes here but, I was testing out my ladders. Standard works fine. However my other ladders do not. My 2nd Ladder (UU) does not give a message in NetBeans. When I tried my 3rd ladder (Ubers), I get...

Code:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'sbdatabase.ladder2' doesn't exist
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1026)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
        at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:995)
        at netbattle.database.registry.DatabaseImpl.postLadderMatch(DatabaseImpl.java:294)
        at netbattle.NetBattleField.informVictory(NetBattleField.java:839)
        at netbattle.NetBattleField.removeClient(NetBattleField.java:562)
        at netbattle.NetClient.executeMessage(NetClient.java:622)
        at netbattle.MessageHandler.run(MessageHandler.java:145)
        at netbattle.NetClient.run(NetClient.java:420)
I'm pretty sure that its a table. I've tried to add a table like that, but the MySQL command line gives me this....

Code:
ERROR 1103 <42000>: Incorrect table name 'sbdatabase'
The code I entered was...

Code:
ALTER TABLE users ADD sbdatabase.ladders2 DOUBLE;
Help?

EDIT: I modified the code to
Code:
ALTER TABLE sbdatabase ADD ladders2 DOUBLE;
And it said...
Code:
Error 1146 <42000>: table 'sbdatabase.sbdatabase' doesn't exist
EDIT2: My MySQL Database is named SBDatabase.


Also is there a way to edit ratings without battling?
 
Well, I tested both ways and I used the codes...

Code:
ALTER TABLE users ADD ladder2 DOUBLE;

the output of that was...

Code:
Error 1060 <42S21>: Duplicate Column name 'ladder2'

I have MySQL Community Server 5.1.37
 
damn.. wasnt thinking when i read that. Ladder 2 is a completely new table. Here is what you need:

Code:
CREATE TABLE `ladder2` (
  `player0` varchar(255) NOT NULL,
  `player1` varchar(255) NOT NULL,
  `victor` int(10) unsigned default NULL,
  KEY `player0` (`player0`),
  KEY `player1` (`player1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

And you also need to add these to the users table:

Code:
ALTER TABLE users
ADD rating2 double default NULL,
ADD deviation2 double default NULL,
ADD volatility2 double default NULL,
ADD estimate2 double default NULL,
ADD updated_rating2 double default NULL,
ADD updated_deviation2 double default NULL,
ADD updated_volatility2 double default NULL;
 
Back
Top