Jump to content

How to create table ?


nowofresh

Recommended Posts

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.

Link to comment

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.

Link to comment

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...