Ok so on the [REL]ItemLock Saving/Loading we are going abit off-topic so I made this topic
So far....
1. Your gonna need a $con connection and the correct MySql connection codes so ....
So far we have the code(s)
add in the Database.cs
HOWEVER the codes in red ARE very vulnerable!...careful with sql-injection guys... Thank you to who ever posted that
I will update this every 5 hours or so
}
So far....
1. Your gonna need a $con connection and the correct MySql connection codes so ....
So far we have the code(s)
add in the Database.cs
Code:
public class Database
{
public const string USER_NAME = "root";
public static string PASSWORD = "";
public const string SERVER = "";
public const string DATA_BASE = "";
static MySqlConnection conn = new MySqlConnection("Server=" + SERVER + ";Database='" + DATA_BASE + "';Username='"[COLOR=Red] + USER_NAME +[/COLOR] "';Password='" [COLOR=Red]+ PASSWORD +[/COLOR] "'");
static bool did = false;
public static MySqlConnection Connection
{
get
{
if (!did)
{ conn.Open(); did = true; conn.StateChange += new System.Data.StateChangeEventHandler(conn_StateChange); }
return conn;
}
}
static void conn_StateChange(object sender, System.Data.StateChangeEventArgs e)
{
if (e.CurrentState == System.Data.ConnectionState.Closed || e.CurrentState == System.Data.ConnectionState.Broken)
{
conn.Dispose();
conn = new MySqlConnection("Server=" + SERVER + ";Database='" + DATA_BASE + "';Username='" + [COLOR=Red][COLOR=Black]USER_NAME[/COLOR][/COLOR] + "';[COLOR=Black]Password[/COLOR]='" + PASSWORD + "'");
conn.Open();
conn.StateChange += new System.Data.StateChangeEventHandler(conn_StateChange);
}
I will update this every 5 hours or so
}