Posts: 528
Threads: 50
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Oct 2011
Reputation:
0
Hey i continue to working on a Tool for my Server , but i got a little Problem with MySql i created this Command
@"INSERT INTO `t_stash03`(`a_index`, `a_user_idx`, `a_item_idx`, `a_plus`, `a_wear_pos`, `a_flag`, `a_serial`, `a_count`, `a_used`, `a_item_option0`, `a_item_option1`, `a_item_option2`, `a_item_option3`, `a_item_option4`, `a_used_2`) VALUES (''," + user_id + ",'"+TitanHelm+"','25','-1','0','','1','-1','0','0','0','0','0','-1')";
I can insert the Command all works fine, i can find it in the DB , but only in the Warehouse the Item is missing.
I think its maybe the Serial but i havent no idea how to Calculate this Serial..^^
Posts: 79
Threads: 8
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Oct 2011
Reputation:
0
i think, the game dont use this database... not implemented?
Posts: 335
Threads: 22
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Aug 2011
Reputation:
0
t_stash is right for wearehouse, the best is if someone has already something in wearehouse and u insert it in the right t_stash where he has already the other item but not sure if this also works, the location of t_stash should be where t_character is
Posts: 528
Threads: 50
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Oct 2011
Reputation:
0
t_stash is right for wearehouse, the best is if someone has already something in wearehouse and u insert it in the right t_stash where he has already the other item but not sure if this also works, the location of t_stash should be where t_character is
Help me out, i will need to select all from all stash the user_id ?
How i can include this in my Code i really dont understand it how to return the selected mysql result in a variable.
string user_id = textBox35.Text;
string sqlHelm = @"INSERT INTO t_stash00 (a_user_idx, a_item_idx, a_serial, a_count, a_used, a_plus)
VALUES ('"+user_id+"', '"+TitanHelm+"', 'MNIKSHJF54', '1', '-1', '25' )";
MySqlConnection con;
MySqlConnectionStringBuilder csb = new MySqlConnectionStringBuilder();
csb.Server = Server;
csb.UserID = user;
csb.Database = _Chardb;
csb.Password = pw;
con = new MySqlConnection(csb.ConnectionString);
MySqlConnection connection = new MySqlConnection(csb.ConnectionString);
connection.Open();
MySqlCommand insertBann = new MySqlCommand(sqlHelm, connection);
int i = insertBann.ExecuteNonQuery();
Posts: 313
Threads: 20
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Jul 2011
Reputation:
0
After you execute the query you should get an result. According to that result where you have to parse that result:
MySqlDataReader myReader = insertBann.ExecuteReader();
try{
//reading rows if the result are multiple rows
while(myReader.Read()){
//if for every column you could use myReader.GetInt32(0), myReader.GetString(0),
//where 0 is the column number(0 first column, 1 second column,...)
int i =myReader.GetInt32(0);
}
}finally{
myReader.close();
connection.close();
}
Posts: 528
Threads: 50
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Oct 2011
Reputation:
0
After you execute the query you should get an result. According to that result where you have to parse that result:
MySqlDataReader myReader = insertBann.ExecuteReader();
try{
//reading rows if the result are multiple rows
while(myReader.Read()){
//if for every column you could use myReader.GetInt32(0), myReader.GetString(0),
//where 0 is the column number(0 first column, 1 second column,...)
int i =myReader.GetInt32(0);
}
}finally{
myReader.close();
connection.close();
}
i Know that but i want the the Result of the MySql Select in a Variable i try it later out^^
Posts: 106
Threads: 15
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Dec 2011
Reputation:
0
I already do a similar tool is easy to do just get the last number of the user id if it is9 insert in t_stash09 Serial will be done itself
Posts: 528
Threads: 50
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Oct 2011
Reputation:
0
I already do a similar tool is easy to do just get the last number of the user id if it is9 insert in t_stash09 Serial will be done itself
Already fixxed it