Small question
#1

Hello, so I follows Konstanios tutorial on how to make a sqllite based account system, so I have added a few things to it but I have a problem. I am trying to save someones birthplace which he will write upon register but I don't know if it is possible to as a blank string or an integer in OnGameModeInit, and I don't know in the db_query to save it as a integer or a string if it is even possible, the point of this is to allow the player to write his own birthplace upon register but I can't really figure it out.
Reply
#2

I don't understand what the problem is. If you have already created a database and you want to add a column, then use either a SQLite Database Browser or execute a query once:
pawn Код:
// syntax:
"ALTER TABLE table_name ADD column_name datatype"
Isn't birthplace supposed to be a text? The answer is the answer to your question about what to use.
Reply
#3

I'm recreating the whole thing, and yes the birthplace is suppose to be a text the problems is I don't know how to put it in the db_query for example "birthplace STRING DEFAULT n/a NOT NULL" or "birthplace VARCHAR(24)"?
Reply
#4

VARCHAR as it's string and replace 24 with the max length the birthplace can have. If it's obligatory for a player to enter their birthplace, then you may want to specify NOT NULL as well.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)