MYSQL Database creating.
#1

Hi.

I have found a gamemode and its missing the database dose anybody know how to create it i would be so greatful if somebody created it for me i wouldn't mind sending the gamemode to you as well.
Reply
#2

bro i can help u send me on skype
Reply
#3

Look through the database for all UPDATE or INSERT INTO queries, check which fields it updates or inserts into and what table that specifically is. Write it down on a piece of paper and now you have the fields, however you'll lack a primary key in each table, add that on top of it all and you're set.

EDIT: It might be useful to mention that you can actually do something called CREATE TABLE IF NOT EXISTS - which you can use to make sure your gamemode always creates the tables when they don't exist and no longer have to worry about wether they exist in the first place.
Reply
#4

There's several ways to get an MySQL database up and running, if you have a host, they might provide you with one, otherwise if you're running your server on your computer, there's different ways to get one up, here's some ways:

Download it directly from their website
http://www.mysql.com/downloads/

Use XAMPP to host a MySQL server on your localhost
https://www.apachefriends.org/index.html

Use Wamp to host a MySQL server on your localhost
http://www.wampserver.com/en/

I've only tried using XAMPP, and there might be more methods than the ones listed.
Once you got a database up and running, the download where you downloaded the gamemode might contain a .sql database file, which you can easily upload to your MySQL database.
If not, look in your script, and see which table names there are, what is being saved, and to which tables and so on, most of the time it's UPDATE or INSERT codes.
Then you can manually set it up by looking at that.
Reply
#5

Quote:
Originally Posted by Extremo
Посмотреть сообщение
Look through the database for all UPDATE or INSERT INTO queries, check which fields it updates or inserts into and what table that specifically is. Write it down on a piece of paper and now you have the fields, however you'll lack a primary key in each table, add that on top of it all and you're set.

EDIT: It might be useful to mention that you can actually do something called CREATE TABLE IF NOT EXISTS - which you can use to make sure your gamemode always creates the tables when they don't exist and no longer have to worry about wether they exist in the first place.
Alright that create table if not exists didn't work. i just don't understand the null crap and whats primary key?

thats why i ask for someone to create it for me as i have no idea what to set them to when creating.
Reply
#6

Quote:
Originally Posted by fonia5
Посмотреть сообщение
Alright that create table if not exists didn't work. i just don't understand the null crap and whats primary key?

thats why i ask for someone to create it for me as i have no idea what to set them to when creating.
I assume you've never ever worked with SQL before, which is why you didn't get any of my references.

I'll link you to w3schools. Now this is probably not the most in depth guide you'll find on SQL, but if you want to be an owner of a server I'd highly recommend you give this tutorial a go and at least understand SQL to some extent.

http://www.w3schools.com/sql/
Reply
#7

Quote:
Originally Posted by Extremo
Посмотреть сообщение
EDIT: It might be useful to mention that you can actually do something called CREATE TABLE IF NOT EXISTS - which you can use to make sure your gamemode always creates the tables when they don't exist and no longer have to worry about wether they exist in the first place.
This is extremely wasteful considering that those will probably only be executed once in the lifetime of the server.

If the database is normalized and has indexes and keys assigned appropriately (rather than just a table "players" with 300 fields) then it will be very hard to just create it out of the blue. Check the script if any queries use the keyword "JOIN".
Reply
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
This is extremely wasteful considering that those will probably only be executed once in the lifetime of the server.

If the database is normalized and has indexes and keys assigned appropriately (rather than just a table "players" with 300 fields) then it will be very hard to just create it out of the blue. Check the script if any queries use the keyword "JOIN".
How is this wasteful? It's maybe five queries or ten in the start of a gamemode. No harm done. It's done in an instant for mysql. This was purely assuming you move to a different server one day and don't have to migrate your data. Either case, if you want to be that picky, simply wrap a pre-processor define around it and you're set. I hardly find this wasteful. Wasteful is developing a gamemode and wasting people's time trying to figure out your database structure.
Reply
#9

Create a new MySQL database according to the gamemode structure...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)