Jump to content

INT or LONG


'LinKin

Recommended Posts

Hello,

When you create a SQL database you must define the type of value of each column

My question is, should I use INT for storing a value given by getTickCount() ?

I think that number is big, maybe not supported with INT type.

Does it exists the type LONG in lua? Can I assing LONG values to a SQL Database?

Thanks.

Link to comment

Lua is only using 'local's' which can be; int, bool, string and nil ( you got a few more, just aint being used that much ). Lua is declaring a double / decimal as an int too ( positions ). Saving them into the database does require the right type. And 'int' is an floating number ( 1, 2, 3, 4, etc ). And since the function says this;

"Returns an integer containing the number of milliseconds since the system the server is running on started. This has the potential to wrap-around.", you'll have to use an int. :)

Link to comment
Lua is only using 'local's' which can be; int, bool, string and nil ( you got a few more, just aint being used that much ). Lua is declaring a double / decimal as an int too ( positions ). Saving them into the database does require the right type. And 'int' is an floating number ( 1, 2, 3, 4, etc ). And since the function says this;

"Returns an integer containing the number of milliseconds since the system the server is running on started. This has the potential to wrap-around.", you'll have to use an int. :)

He means in SQL.

I would just use INT.

Link to comment
Lua is only using 'local's' which can be; int, bool, string and nil ( you got a few more, just aint being used that much ). Lua is declaring a double / decimal as an int too ( positions ). Saving them into the database does require the right type. And 'int' is an floating number ( 1, 2, 3, 4, etc ). And since the function says this;

"Returns an integer containing the number of milliseconds since the system the server is running on started. This has the potential to wrap-around.", you'll have to use an int. :)

He means in SQL.

I would just use INT.

I know, that's what I said. lua is only using int, bool, string and nil, so no trouble there. Only thing is, "Saving them into the database does require the right type". Since the function returns an INT, I'd go for the INT too... might not have been clear, soz. ^^"

Link to comment
I know, that's what I said. lua is only using int, bool, string and nil, so no trouble there. Only thing is, "Saving them into the database does require the right type". Since the function returns an INT, I'd go for the INT too... might not have been clear, soz. ^^"

That doesn't make any sense. Lua always returns either a float or an integer when talking about numbers, there are just two types. SQL databases have many different types of different uses. I am not sure how long the return of getTickCount is, but I assume if it's over 10 characters long, you've got to use a big integer or so.

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