mysql "Set"

08/21/2013 01:48 Garedx#1
Str8 into the point ... some columns or tables in my database doesn't obey the Set command
ex:
when you create a character, the EntityID of account is supposed to be set as the EntityID
but that doesn't happen it remains 0
so u have to create a new character every time u login ... despite the entity is created is already
it just doesn't link to the account because the EntityID didn't set
the question is ... why doesn't it set?
08/21/2013 02:58 Aceking#2
Without your code there isnt really a way to know for sure.

Although I think you are referring to Insert?
08/21/2013 03:52 Garedx#3
okay i will get an example:
on Character creation :
PHP Code:
client.account.EntityID client.Entity.EntityID;
account.save(); 
later on accounttable.cs
PHP Code:
public void Save()
         {
             if (
exists)
             {
                 
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
                 
cmd.Update("accounts").Set("Password"Password).Set("IP"IP).Set("EntityID"EntityID).Set("LastCheck", (ulong)DateTime.Now.ToBinary()).Where("Username"Username).Set("festivalclaim",festival).Execute();
             }
             else
             {
                 try
                 {
                     
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
                     
cmd.Insert("accounts").Insert("Username"Username).Insert("Password"Password).Insert("State", (byte)State).Execute();
                 }
                 catch (
Exception e) { Program.SaveException(e); }
             } 
08/21/2013 04:18 Aceking#4
Is anything being changed at all?

Try changing:
Code:
cmd.Update("accounts").Set("Password", Password).Set("IP", IP).Set("EntityID", EntityID).Set("LastCheck", (ulong)DateTime.Now.ToBinary()).Where("Username", Username).Set("festivalclaim",festival).Execute();
to

Code:
cmd.Update("accounts").Set("Password", Password).Set("IP", IP).Set("EntityID", EntityID).Set("LastCheck", (ulong)DateTime.Now.ToBinary()).Set("festivalclaim",festival).Where("Username", Username).Execute();
08/21/2013 06:15 Garedx#5
Quote:
Originally Posted by Aceking View Post
Is anything being changed at all?

Try changing:
Code:
cmd.Update("accounts").Set("Password", Password).Set("IP", IP).Set("EntityID", EntityID).Set("LastCheck", (ulong)DateTime.Now.ToBinary()).Where("Username", Username).Set("festivalclaim",festival).Execute();
to

Code:
cmd.Update("accounts").Set("Password", Password).Set("IP", IP).Set("EntityID", EntityID).Set("LastCheck", (ulong)DateTime.Now.ToBinary()).Set("festivalclaim",festival).Where("Username", Username).Execute();
OMG o.O

I thought i removed that long time ago!!

ThnQ you are a savior .... It got to be the error of course :)

ThnQ again and god mercy my memory -_-