Register for your free account! | Forgot your password?

You last visited: Today at 12:38

  • Please register to post and access all features, it's quick, easy and FREE!


mysql "Set"

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2013
Posts: 18
Received Thanks: 0
mysql "Set"

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?



Garedx is offline  
Old 08/21/2013, 02:58   #2
 
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 270
Without your code there isnt really a way to know for sure.

Although I think you are referring to Insert?


Aceking is offline  
Old 08/21/2013, 03:52   #3
 
elite*gold: 0
Join Date: Jun 2013
Posts: 18
Received Thanks: 0
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); }
             } 
Garedx is offline  
Old 08/21/2013, 04:18   #4
 
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 270
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();


Aceking is offline  
Old 08/21/2013, 06:15   #5
 
elite*gold: 0
Join Date: Jun 2013
Posts: 18
Received Thanks: 0
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 *** mercy my memory -_-


Garedx is offline  
Reply



« System Timers Question | Question regarding hand & hand2 »



All times are GMT +1. The time now is 12:38.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.