AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Checking from DB (https://forums.alliedmods.net/showthread.php?t=121198)

SpeeDeeR 03-12-2010 18:56

Checking from DB
 
How to check if a player has registered his steamid or ip in mysql.

Lets say that i own a site and there you can enter your steamid or ip.My question is how to check if there is such information written.
If there is any to give him some privilege if not to return "you are not signed" or smth like that.

Seta00 03-12-2010 19:11

Re: Checking from DB
 
Post your database layout (if any).
And read this: http://forums.alliedmods.net/showpos...18&postcount=5

SpeeDeeR 03-14-2010 11:01

Re: Checking from DB
 
Quote:

Originally Posted by Seta00 (Post 1115735)
Post your database layout (if any).
And read this: http://forums.alliedmods.net/showpos...18&postcount=5

I actually read that ...
I've decided to check for steamid from DB and check session for nonsteam users,because some ppl have dynamic IPs.

Here is the DB
Code:

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(225) NOT NULL auto_increment,
  `username` varchar(225) NOT NULL,
  `password` varchar(225) NOT NULL,
  `email` varchar(225) NOT NULL,
  `ip` varchar(225) NOT NULL,
  `steamid` varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL,
  `editip` varchar(255) NOT NULL,
  `skype` varchar(225) NOT NULL,
  `web` varchar(225) NOT NULL,
  `podpis` varchar(225) NOT NULL,
  `avatar` varchar(225) NOT NULL,
  `level` varchar(225) NOT NULL,
  `date` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP,
  `session` varchar(32) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=cp1251 AUTO_INCREMENT=54 ;

A friend, who is working with mysql,adviced me to check for nonsteam with
Code:

$session=session_id();
I hope this helps :)
I will give more additional info if needed.

Seta00 03-14-2010 15:25

Re: Checking from DB
 
Non-Steam users have STEAM_ID_LAN / STEAM_ID_PENDING as their authids.

Use SQLx to query your database.

I'm not coding it for you, this is Scripting Help, not Suggestions / Requests.

AntiBots 03-14-2010 15:31

Re: Checking from DB
 
SELECT id FROM users WHERE steamid='here steam id' OR ip='here ip' LIMIT 1;

then check row num or nextrow...

Just read the SQLx Tutorial.


All times are GMT -4. The time now is 08:40.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.