Register for your free account! | Forgot your password?

You last visited: Today at 18:54

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

Advertisement



Problem with MySQL

Discussion on Problem with MySQL within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
U2_Caparzo's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 314
Received Thanks: 90
Problem with MySQL

Hi.

I started to try to change the NewestCOServer database to MySQL. i'm using the MySQLhandler.dll that come with the 5355 Hellmoth Source, i think it is the same that used Elite Co-Emu. but i have a problem when using the INSERT method to create a character, it doesn't insert nothing :c, but i can insert data in other tables, that confused me.

i have this in program.cs

to begin the connection
Code:
                MySqlHandler.MySqlArgument arg = new MySqlHandler.MySqlArgument();
                arg.User = "root";
                arg.Password = "";
                arg.Host = "localhost";
                arg.Database = "armagedon";
                MySqlHandler.Connections.Open(arg);
                MySqlHandler.MySqlCommandHandler.TurnOn();
if i add this to that code to it

Code:
MySqlHandler.MySqlCommand cmd = new MySqlHandler.MySqlCommand(MySqlHandler.MySqlCommandType.INSERT);
                cmd.Insert("test").
                Insert("Nombre", "Testing").Execute();
it works fine, but with this

Code:
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
            cmd.Insert("players")
            .Insert("EntityID", entityID)
            .Insert("Account", Account)
            .Insert("Character", Name)
            .Insert("Avatar", avatar)
            .Insert("Body", Body)
            .Insert("Hair", Hair)
            .Insert("Map", 1010)
            .Insert("X", 61)
            .Insert("Y", 109)
            .Insert("Job", Job)
            .Insert("Str", Str)
            .Insert("Agi", Agi)
            .Insert("Vit", Vit)
            .Insert("Spi", Spi)
            .Insert("CurHP", HP)
            .Insert("CurMP", CurMP)
            .Insert("Silvers", 100)
            .Insert("WHPassword", WHPassword)
            .Insert("Spouse", none)
            .Execute();
it don't works, none and WHPassword are strings defined already, same with integers values, so i dk what is wrong.

i hope that someone with more experience can help me with this...

Thanks
U2_Caparzo is offline  
Old 04/30/2012, 05:31   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
The fields in your insert code bust exactly follow the table structure.

EG: Look at the database and make sure your insert query here fills in EVERY value that does not have a default database value (map/x/y and others do iirc, they would be auto filled in)

That being said... If you're going to go through the effort of converting a source or setting up your own database system... Use nhibrinate or some other system. The sqlhandler is kinda ****. We were working on converting stuff in albetros but never bothered finishing it up.
pro4never is offline  
Old 04/30/2012, 05:50   #3
 
U2_Caparzo's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 314
Received Thanks: 90
Quote:
Originally Posted by pro4never View Post
The fields in your insert code bust exactly follow the table structure.

EG: Look at the database and make sure your insert query here fills in EVERY value that does not have a default database value (map/x/y and others do iirc, they would be auto filled in)

That being said... If you're going to go through the effort of converting a source or setting up your own database system... Use nhibrinate or some other system. The sqlhandler is kinda ****. We were working on converting stuff in albetros but never bothered finishing it up.
i see, but, is NHibernate more complex to use? i have to say that this would be my first time trying with MySQL so i have a lot to learn yet, and NHibernate i just heard of it when u posted Albetros and now :s... going to download it to see.
Thanks
U2_Caparzo is offline  
Old 04/30/2012, 06:58   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
NHibrinate is more work to set up but easier to use.

You essentially map your database in the source side and can then access, modify and safe them almost like you would any normal collection of data inside the source itself.

Basically you have a database object representing each record in that database. You can pull these records by any method you like.

Take a look at albetros and how it handles the DB objects, will give you a small idea.

Definitely more work in the setup though.
pro4never is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[PROBLEM]:[Root]:Mysql:[...]/tmp/mysql.sock
10/22/2011 - Metin2 Private Server - 3 Replies
Hallo Community habe jetzt seit ein Paar Tagen einen Fehler Namens: failed, retrying in 5 secondsmysql_real_connect: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) Screen: http://img809.imageshack.us/img809/9805/helpg.png
Problem mit Mysql
10/19/2011 - Metin2 Private Server - 0 Replies
Heyho, Ich brauche umbedingt deine hilfe. Ich hab mein P-server mit einem Tutorial gemacht, und hab alles bei Virtuall Pc so gemacht wie es sein muss. Und jetzt wollte ich alles bei Mysql eingeben. Und klicke auf Connecting. Dann kommt immer: 2003-Can´t connect to mysql server on ´5.37.47.100´(10060)
Mysql Problem.
10/03/2011 - Metin2 Private Server - 4 Replies
Hey Leute. Habe gerade mein neuen Root aufgesetzt nur jetzt bekomme ich diesen error wenn ich mich mit Navi cat verbinden will. ImageShack® - Online Photo and Video Hosting Hoffe einer kann mir helfen.
Problem mit der HP + MySQL
06/10/2011 - Metin2 Private Server - 4 Replies
Schönen guten Morgen liebe Com., Zur Zeit plagt unser Server folgende Probleme: • Ranking • Itemshop • Register Auf die Probleme an sich werde ich jetzt genauer eingehen. Es wird aufjedenfall immer angezeigt das Probleme mit dem MySQL Server auftreten. Wir denken aber eher daran, dass die Datenbank einfach die kapazität des Webhosts überschreidet. Trotzdem bitte ich euch dies hier mal genau anzuschauen. Dazu zu sagen ist, das bis vor kurzem alles ging und einwandfrei lief!
MYSQL problem in php
04/08/2011 - Web Development - 3 Replies
Hallo, ich hab folgenedes problem ich hab den fehler : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in H:\xampplite\htdocs\kontaktliste.php on line 22 Ich weiß net was da falsch ist der quellcode in php ist: while ( $datesatz = mysql_fetch_array($erg, MYSQL_ASSOC) ) { print_r ($datesatz); } Hoffe es hat jemand schnell ne lösung :)



All times are GMT +1. The time now is 18:55.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.