SA-MP Forums Archive
Saving Guns MYsql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Saving Guns MYsql (/showthread.php?tid=508426)



Saving Guns MYsql - qmnty - 22.04.2014

Can i save Guns player data using MYSQL like This

pawn Код:
for(new s = 0; s < 12; s++)
    {
        format(Query, sizeof(Query), "INSERT INTO playerdata (Gun%d) VALUES(0)")
        mysql_query(Query);
    }
I tried like that code.
But it has no efect on data.

Anyone can help?


Re: Saving Guns MYsql - SkittlesAreFalling - 22.04.2014

for(new s = 0; s < 12; s++) {
format(Query, sizeof(Query), "INSERT INTO playerdata (Gun%d) VALUES (0);", s)
mysql_query(Query);
}

Not very recommended though.


Re: Saving Guns MYsql - qmnty - 22.04.2014

Is that VALUES of guns data can make 12 data guns variables?


Re: Saving Guns MYsql - Flake. - 22.04.2014

If I'm correct you're trying to save the players weapons they have on them at that current point? If so you'll have to workout how many guns they have and GetPlayerWeapons then save them.


Re: Saving Guns MYsql - SkittlesAreFalling - 22.04.2014

If you already have the columns created, it will make 12 rows and each will have the value 0 on different columns.


Re: Saving Guns MYsql - qmnty - 22.04.2014

Okay..
I'll try that.

Why it's not recommended?


Re: Saving Guns MYsql - SkittlesAreFalling - 22.04.2014

MySQL is not very efficient if you have little knowledge for it.


Re: Saving Guns MYsql - qmnty - 22.04.2014

But MYSQL had strong Database.
Isn't it?

If there's another better than MYSQL..
What is it?


Re: Saving Guns MYsql - SkittlesAreFalling - 22.04.2014

SQLite.

https://sampwiki.blast.hk/wiki/Db_open
https://sampwiki.blast.hk/wiki/Db_close
https://sampwiki.blast.hk/wiki/Db_query
https://sampwiki.blast.hk/wiki/Db_free_result


Re: Saving Guns MYsql - qmnty - 23.04.2014

How to make This multiple TABLES to one TABLES MYSQL..?

http://pastebin.com/r2kvHZDx

It's just make One TABLES just make TABLES on line first mysql_query...