SA-MP Forums Archive
I need help 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I need help MySql (/showthread.php?tid=66782)



I need help MySql - rafaelrfa1 - 24.02.2009

I can save the information in mysql but not can not catch them.


Re: I need help MySql - [RP]Rav - 24.02.2009

Код:
SELECT `field`, `field`, `field` FROM `table` WHERE `field`='value'
or something a long those lines


Re: I need help MySql - Coicatak - 24.02.2009

It depends on what you want to catch...

Look at the example below.
pawn Код:
new fields[25][40];
      new model[128];
      if(PlayerInfo[playerid][pCarkey] != 999)
      {
        format(sql, sizeof(sql), "SELECT * FROM cars WHERE %d", PlayerInfo[playerid][pCarkey]);
        samp_mysql_query(sql);
            samp_mysql_store_result();
            samp_mysql_fetch_row(row);
            split(row, fields, '|');
            samp_mysql_free_result();
            format(model, sizeof(model), "%s", strval(fields[10]));
            format(string, sizeof(string), "*Vйhicule 1: %s || ID: %d", model, PlayerInfo[playerid][pCarkey2]);
        if(TmpCarID[TmpCarKeys[playerid]] == PlayerInfo[playerid][pCarkey] || TmpCarID[TmpCarKeys2[playerid]] == PlayerInfo[playerid][pCarkey]) SendClientMessage(playerid, COLOR_GREEN, string);
        else SendClientMessage(playerid, COLOR_WHITE, string);
        }