09.04.2016, 06:18
Great tutorial, would be great if you could explain what a query does/send in depth aswell, plus how do you know the parameters for the queries?
For example
and
The first one doesn't use the same format as the second (SELECT field FROM table WHERE field = something)
Thanks tho!
For example
Code:
db_query( Database, "CREATE TABLE IF NOT EXISTS users (userid INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(24) COLLATE NOCASE, password VARCHAR(129), admin INTEGER DEFAULT 0 NOT NULL)" ); return 1;
Code:
ormat( Query, sizeof( Query ), "SELECT password FROM users WHERE username = '%s' LIMIT 0, 1", DB_Escape( User[ playerid ][ USER_NAME ] ) );// SELECT field FROM table WHERE field = something. Take a look at the DB_Escape Result = db_query( Database, Query );
Thanks tho!