AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Help a noob set up SQL for their server. (https://forums.alliedmods.net/showthread.php?t=298621)

QuantumToast 06-18-2017 06:02

Help a noob set up SQL for their server.
 
Hello all, you might recognize me from my oh-so-popular thread over here, Infractions. I know absolutely nothing about SQL, outside of the tiny bits of experience I have directly modifying some databases in the past.
It is to my understanding that Sourcemod has basic support for MySQL and SQLite. While there is obviously documentation, examples, and help for the aforementioned topic, my questions lie more in the range of SQL itself. I'll try and be concise and just list my questions here.
  1. How easy/difficult is it to set up an SQL database for a dedicated server? (This is on a game server provider, I am not hosting my server locally.)
  2. Does setting up SQL on my server require an SQL database hosting program?
  3. If not, am I supposed to put the database files somewhere specific?
  4. What are some good resources to learn syntax and formatting for SQL queries and "commands", if you will?
I know some of these questions are easily Google-able, but since they aren't just basic SQL-related commands, and more related to its integration into Sourcemod, I felt the need to ask it here. I've never used SQL before, so please, go easy on me if you can. I'm willing to learn. Have a good day :)

8guawong 06-18-2017 07:49

Re: Help a noob set up SQL for their server.
 
1. easy if you are using a GSP
2. yes for mysql and no for sqlite
3. for sqlite just setup the database.cfg inside sourcemod/config folder
4. google is best for this answer

Kryptanyte 06-18-2017 07:59

Re: Help a noob set up SQL for their server.
 
Not that difficult at all. I suggest you take a look at the wiki entry:

https://wiki.alliedmods.net/SQL_(SourceMod_Scripting)

I believe if you use SQLite you have to create database tables via the plugin. Not too sure though as I've never really used it.

SQLite doesn't require any hosting program as it's a local file stored inside of the sourcemod folder. MySQL on the other hand does. Usually this is externally hosted and can be used for multiple servers.

You don't really need to worry about SQL Commands specifically, just syntax and the language really. This is one place you could learn about the language:
https://www.w3schools.com/SQL/deFault.asp

You could also look how other plugins handle their databasing as well, in fact I recommend doing this as it'll help you understand the flow of SQL in sourcemod


All times are GMT -4. The time now is 02:54.

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