Jump to content

How to create table ?


nowofresh

Recommended Posts

Posted

Hey,

How Can table with categories

Users

-ID

-X

-Y

-Z

-Username

-Nick

I don't know how to use MTA-MySQL functions to do this.

Can u write for me, example script ? :cry:

Posted

Ok a very simple one.

function startSQLOnStart() 
executeSQLCreateTable("Users", "Serial STRING") 
executeSQLCreateTable("EveryIDName", "ID INT") 
executeSQLCreateTable("XPosName", "XPos INT") 
executeSQLCreateTable("YPosName", "YPos INT") 
executeSQLCreateTable("ZPosName", "Zpos INT") 
end 
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), startSQLOnStart) 

When you create table you can save things into it.

Posted

I'm not an expert in SQL, I just started to use it >.<

But this could work:

executeSQLCreateTable("TheTableName", "player TEXT, playerid INTEGER, posX INTEGER, posY INTEGER, posZ INTEGER") 

You can do anything you want with that table using the following functions:

executeSQLUpdate 
executeSQLInsert 
executeSQLSelect 
executeSQLQuery 

Click on every function name to visit wiki documentation and learn.

Posted

Your [lua] tag is FAIL lol.

Scoreboard could be used to show the player stats to all, but there is very low width to make columns huh.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...