Solved Help With MySQl database

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

AlphaAnonymous

*Creating A Perfect World
Dank Tier Donator
Nobleman
Aug 9, 2012
153
798
1
Hello Members Of GuidedHacking,

Question #1
I was wondering if anyone knew how to make account rankings using a MySQL database. Like for example. 1 = Admin, 2 = Mod, 3 = Normal User, etc... This program is in VB. Please help if you can.

Question #2
Does anyone know how to not allow double log in with the same account?
 

voidisalive

Jr.Coder
Full Member
Nobleman
May 27, 2012
67
458
3
Hey Alpha, you can insert this table query into the db(database) and it will create this fields on the database of your choice.
C++:
CREATE TABLE tUsers (
  user_id INT NOT NULL AUTO_INCREMENT,
  email VARCHAR(80) NOT NULL,
  dispName VARCHAR(50) NOT NULL,
  password CHAR(41) NOT NULL,
  admin INT (1 IF IS ADMIN 0 IF NOT ADMIN) AUTO_INCREMENT,
  mod INT (1 IF IS MOD 0 IF NOT MOD ) AUTO_INCREMENT,
  PRIMARY KEY (user_id),
  UNIQUE INDEX (email)
) ENGINE=INNODB;
if you create the site from scratch then you can just simply create control pannels like the admin will have surtain features on that page

and the mod will have another diffrent page with less options then the admin and the regular user will just have regular features, is that simple.



Edit: sorry for some reason I didn't see your question 2 but it should be easy a query should do the trick

C++:
//here we query the data base to select all from the table users the user name field to be check with the one being enter
$query = mysql_query("SELECT * FROM users WHERE Username='$user_id'");
if(mysql_num_rows($query) > 0){
	echo 'User name already exits! please user another one';
	//else if the user name is not on the data base then we can insert it into it.
}else{
		mysql_query("INSERT INTO users (Username, Password) VALUES ('$user_id', '$password'))");
		//we write a message saying they have register etc...
		echo 'Congratulations you have register now go login and enjoy!';
		
		header("location:index.php");//this can be any page that has the login can be header("location:login.php");
		//we send them back to the login page so they can login if this happens
}
is as simple as that and you have a user name check on the data base upon registration.

and if this is not what you mean what you can do is log a HWID on that account and store it on the database and if the user shares that account somewhere else

you can do a check against the database and see if the HWID matches if not then you can print out a message saying this is your first warning please do not share accounts. something like that .


Greets,

voidisalive
 
Last edited:

AlphaAnonymous

*Creating A Perfect World
Dank Tier Donator
Nobleman
Aug 9, 2012
153
798
1
Hey Alpha, you can insert this table query into the db(database) and it will create this fields on the database of your choice.
C++:
CREATE TABLE tUsers (
  user_id INT NOT NULL AUTO_INCREMENT,
  email VARCHAR(80) NOT NULL,
  dispName VARCHAR(50) NOT NULL,
  password CHAR(41) NOT NULL,
  admin INT (1 IF IS ADMIN 0 IF NOT ADMIN) AUTO_INCREMENT,
  mod INT (1 IF IS MOD 0 IF NOT MOD ) AUTO_INCREMENT,
  PRIMARY KEY (user_id),
  UNIQUE INDEX (email)
) ENGINE=INNODB;
if you create the site from scratch then you can just simply create control pannels like the admin will have surtain features on that page

and the mod will have another diffrent page with less options then the admin and the regular user will just have regular features, is that simple.



Edit: sorry for some reason I didn't see your question 2 but it should be easy a query should do the trick

C++:
//here we query the data base to select all from the table users the user name field to be check with the one being enter
$query = mysql_query("SELECT * FROM users WHERE Username='$user_id'");
if(mysql_num_rows($query) > 0){
	echo 'User name already exits! please user another one';
	//else if the user name is not on the data base then we can insert it into it.
}else{
		mysql_query("INSERT INTO users (Username, Password) VALUES ('$user_id', '$password'))");
		//we write a message saying they have register etc...
		echo 'Congratulations you have register now go login and enjoy!';
		
		header("location:index.php");//this can be any page that has the login can be header("location:login.php");
		//we send them back to the login page so they can login if this happens
}
is as simple as that and you have a user name check on the data base upon registration.

and if this is not what you mean what you can do is log a HWID on that account and store it on the database and if the user shares that account somewhere else

you can do a check against the database and see if the HWID matches if not then you can print out a message saying this is your first warning please do not share accounts. something like that .


Greets,

voidisalive
How about the VB Code part? Sorry if I sound noob-ish. This MySQL database thing is new to me, but I need it.
And I believe the code you gave me is for PHP not VB.
 
Last edited:

Helios

Coder
Meme Tier VIP
May 24, 2012
207
1,113
4
You should probably start out with something basic. One of my friends tried this tutorial, he didn't learn much from it, but this should give you a basic idea of how to do it. <- That won't be very secure though, this is just to get you going.
 

AlphaAnonymous

*Creating A Perfect World
Dank Tier Donator
Nobleman
Aug 9, 2012
153
798
1
You should probably start out with something basic. One of my friends tried this tutorial, he didn't learn much from it, but this should give you a basic idea of how to do it. <- That won't be very secure though, this is just to get you going.
I think doing it that way, it won't allow other people to be able too log in/connect. Correct me if I'm wrong. And I already have a log in system. I just need to add those additional stuff to make sure my program is going to be safe. I just need
1. Ranking System
2. Not allowing 2 users to log on to the same account at the same time.
 

Crazywink

Hacker
Meme Tier VIP
Dank Tier Donator
Jul 18, 2012
626
4,613
17
If you already have a log in system, it's as simple as reading the other tables information where the logged in username row is. You'd just add in a column for a Ranking System, set it to integer or whatever you want, then have your program retrieve that information from the database using the same method you used for the log in method.

Crazywink
 

konsowa

Coder
Full Member
Nobleman
May 24, 2012
178
753
2
To check if the user is logged in or not u can add a bool field, and set it to true when a user logs in and then back to false when he logs out, that way if its set to true and someone tries logging in using that account u can check if its set to true=online or not ;)
 

mepath

Newbie
Full Member
Sep 1, 2012
13
242
0
You should be careful with acronyms. For the longest time, I was thinking vBulletin, and pondering why would you go through the lengths of roles via mysql, when the administration panel does that for you. You need to understand one-to-one, one-to-many, many-to-many relationships, and determine which structures you need.

If a user can be an adminsitrator, and a member, then it's most likely a one-to-many relationship. One user to many roles. So you'll have a role table, and a user table. The rest of your code will have to check whether or not a user has the ability to log in, and then check whether or not the user has the required roles and etc. Finally, if you want to disallow two users from logging at the same time, you can take a page out of earlier implementations of what you're trying to do. Essentially, what a lot of companies did, was simply log the first person off, as soon as the first person logged on. Think back to the AOL days... There are many ways to implement the log off check, and I'm sure you've already thought of a few yourself.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods League of Legends Accounts