[Tutorial] Making A simple User DataBase with SQLite
#1

removed.
Reply
#2

i recognize most of the explanation in the introduction from the sqlite website, but it's always a good idea to have it here on forums.

note -> you have a header called "feature" but it links me to the sqlite website. If I wanted information from the sqlite website I wouldn't be looking here in the first place, i'd just visit their site (which is probably more accurate). it'd be best to list any findings/information from the site directly (that's the purpose of brief explanations, but make sure it's sourced).

and if i were to copy pasta like most people do, i'd get errors and probably whine and complain in this thread (hint: close your strings).

other than that, it's OK i guess.
Reply
#3

Quote:
Originally Posted by arbit
Посмотреть сообщение
i recognize most of the explanation in the introduction from the sqlite website, but it's always a good idea to have it here on forums.

note -> you have a header called "feature" but it links me to the sqlite website. If I wanted information from the sqlite website I wouldn't be looking here in the first place, i'd just visit their site (which is probably more accurate). it'd be best to list any findings/information from the site directly (that's the purpose of brief explanations, but make sure it's sourced).

and if i were to copy pasta like most people do, i'd get errors and probably whine and complain in this thread (hint: close your strings).

other than that, it's OK i guess.
Okay Thanks and yes I took few lines from the main site to help me introducing SQLite better here.
Reply
#4

Then cite your sources. You basically copied it word-for-word, and just changed the order a bit. Even if this just a mod for a 9 year old game, the rules of plagiarism still apply.

Also, I would have really liked this tutorial if you didn't use crappy methods. Everyone using SQLite should take advantage of an auto increment field, and also make use of db_get_field. Theoretically (I say that because I haven't looked through the sqlite source) db_get_field_assoc has to run a loop comparison through all the field names in order to return data causing you to lose time.

In other words, this tutorial is pretty much the same as all of the other ones posted, and doesn't really explain much.
Reply
#5

No explanation whatsoever. Just some bunch of tutorials from other sites stacked up.
Reply
#6

PHP код:

forward 
public UpdateData(playerid);
public 
UpdateData(playerid)
{
    new
        
Query[200],
        
name[MAX_PLAYER_NAME]
    ;
    
GetPlayerName(playeridnamesizeof(name));
    
format(Query,sizeof(Query),"UPDATE `USERS` SET  CASH = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));                                                                                                   
    
db_free_result(db_query(UsersQuery));
    return 
1;

Any reason why you are using callbacks rather then stock functions? Stock functions use less cpu.
Reply
#7

You should of used more up to date methods of SQLite like Slice's BUD.
Reply
#8

theres a mistake,
pawn Код:
ConnectSQL();
should be
pawn Код:
ConnectSQLite();
otherwise you get
pawn Код:
error 017: undefined symbol "ConnectSQL"
this is because you forwarded
pawn Код:
forward public ConnectSQLite(); //<---- SQLite and not SQL.
public ConnectSQLite()
{
    Users = db_open("PlayersBase.db");
    db_query(Users, "CREATE TABLE IF NOT EXISTS `USERS` (`NAME`, `PASSWORD`, `CASH`)");
    print("[SQL]:`Has connected Succesfully`");
    return 1;
}
Reply
#9

I did everything correctly but everytime i relog a new account is made in the database and the money doesnt save correctly. sorry but this tutorial is messed up.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)