Register for your free account! | Forgot your password?

You last visited: Today at 05:16

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


Problem with database Saving

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,524
Received Thanks: 230
Problem with database Saving

i made Cloudsaint jar Table but its not working

heres my codes

Code:
using System;
using System.IO;
using System.Text;
using Conquer_Online_Server.ServerBase;
using System.Collections.Generic;
using Conquer.Database;

namespace Conquer_Online_Server.Database
{
    public class JarTable
    {
        public enum States : ushort
        {
            HaventStarted = 0,
            Stared = 1
        }
        public uint Kills, Required, Count, State, Type;
        public string Player;
        public JarTable(string player)
        {
            this.Player = player;
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
            cmd.Select("CloudSaint").Where("Name", player);
            MySqlReader r = new MySqlReader(cmd);
            if (r.Read())
            {
                this.Kills = r.ReadUInt32("Kills");
                this.Type = r.ReadUInt32("Type");
                this.Required = r.ReadUInt32("Required");
                this.Count = r.ReadUInt32("Count");
                this.State = r.ReadUInt32("Started");
                this.Player = r.ReadString("Name");

            }
            r.Close();
        }
        public void UpdateJar()
        {
            Database.MySqlCommand cmd = new Database.MySqlCommand(Database.MySqlCommandType.UPDATE);
            cmd.Update("CloudSaint").Set("Required", Required).Set("Kills", Kills).Set("Started", State).Set("Count", Count).Set("Type", Type).Where("Name", Player).Execute();
        }
    }
}
when i get the Jar nothing inserted Into the Table Coloumns

Have i missed smthing ?



shadowman123 is offline  
Old 04/18/2012, 10:33   #2
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,124
Received Thanks: 2,503
When you create the jar you read from the database, not write. The only time you write is when you update the jar, but you perform an update and not an insert, so yeah i would say you missed quite alot.


Korvacs is offline  
Thanks
1 User
Old 04/18/2012, 15:27   #3
 
elite*gold: 0
Join Date: Oct 2007
Posts: 1,504
Received Thanks: 573
like Korvacs said, you only update them but there is nothing to update so you have to make it insert a line first and that way you can update it everytime there is a kill.
turk55 is offline  
Old 04/20/2012, 04:23   #4
 
elite*gold: 0
Join Date: Nov 2010
Posts: 104
Received Thanks: 95
f5


awesome100able is offline  
Thanks
1 User
Old 04/20/2012, 10:21   #5
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 783
Quote:
Originally Posted by awesome100able View Post
f5
Such informative post!
I don't have a username is offline  
Thanks
3 Users
Old 04/21/2012, 00:01   #6
 
elite*gold: 0
Join Date: Nov 2010
Posts: 104
Received Thanks: 95
Quote:
Originally Posted by I don't have a username View Post
Such informative post!
LOL


awesome100able is offline  
Reply



« [HELP]What is this :(? | About 5095 source :) »

Similar Threads
Guide pour Sauvegarder sa base de donnée FR/US Guide to Saving the database! FR/US !
01/18/2012 - Rappelz Private Server - 2 Replies
Bonjour, Petit guide (By darckistyle) pour faire une sauvegarde de son serveur ! Vous ne vous êtes jamais dit : comment sauvegarder ma base de donnée en cas de crash ? Car si vous pensez que dans le sql que toutes vos donnée qui y sont sont aussie dans le fichier ou se situe la base de donnée, C'EST UNE GRANDE ERREUR ! Vous pouvez toujour faire un copier collée, rien est sauvegarder, il vous faut faire une sauvegarde manuelle pour gardé toutes vos donnée.
problem in Saving the Halos
07/25/2011 - CO2 PServer - Discussions / Questions - 0 Replies
Im using Source 5375 which contain Class pk and elite one too but when i dc and login the Halos Disappear and i got same problem with GUild Awarder npc So it makes a bug that the gl of winning guild can claim millions of awards at same time So ..Can any1 tell me How to make Source Save halos including elite , class pk and Guildwar halos ???
Saving Chunks problem!
07/09/2011 - Minecraft - 8 Replies
Hallo, Ich hab ein Problem, immer wenn ich in irgendeine map Öfen öffne kommt saving chunk. Ich kann aber die map wieder öffnen. Kann mir einer helfen? Danke im Vorraus ;)
Help in saving problem!
02/25/2010 - Technical Support - 1 Replies
HI... i have a hard time saving things because of this, its like this when i save things or browse things nothing comes out. and i cant even put an attachment here :( help....
[Problem] With Saving PrevJob..
07/06/2009 - CO2 PServer - Discussions / Questions - 8 Replies
Ok This Thing wont save anyone Prevjob i have Charc.SavePrevjob in the Reborn Script anyone got an hints? Useing a 5017 source



All times are GMT +1. The time now is 05:16.


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.