Need help
#1

I need a help with MySQL.I don't know how to convert my script to MySQL

I need an example, how to convert this script to MySQL script.

pawn Код:
dUserSetINT(PlayerName2(playerid)).("level",0);
        dUserSetINT(PlayerName2(playerid)).("LastOn",0);
        dUserSetINT(PlayerName2(playerid)).("money",0);
        dUserSetINT(PlayerName2(playerid)).("kills",0);
        dUserSetINT(PlayerName2(playerid)).("deaths",0);
Reply
#2

Hello.
pawn Код:
dUserSetINT
mm, I do not know this syntax.

Nvm, first at all you've to create MySQL base. Do you have one?
If no, then create it, there are threads about it on this forums, just use "SEARCH" option.
If yes, then you can do something like this:
pawn Код:
format(query, sizeof(query), "UPDATE table_name SET column_name = value WHERE PlayerName = %s", PlayerName2(playerid));
. This is an example ofc, it won't work in this way I wrote, you need to configure this for yourself.

Greetz,
LetsOWN
Reply
#3

I just want to convert this to mysql

pawn Код:
dUserSetINT(PlayerName2(playerid)).("level",0);
So it would be easy for me to convert everything.
Reply
#4

So as above.
If you have created & connected to MySQL db, you can perform queries which will add values into columns/tables.
If you need help with MySQL database, head over here:
https://sampwiki.blast.hk/wiki/MySQL

If you'll have basic knowlege of MySQL (or if you have already), then you can create query to mysql base from
pawn Код:
[dUserSetINT(PlayerName2(playerid)).("level",0);
And it should look somehow like this
pawn Код:
format(query, sizeof(query), "Update table_name Set level = %d Where PlayerName = %s", level, PlayerName2(playerid));
or somethink like this. I dunno how You have wroten your script, so from this level it is all what I can say to you.
Maybe someone other here will guide you better.

Greetz,
LetsOWN
Reply
#5

I am using ladmin system, i want to convert the script to mysql.
Can anyone help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)