MySQL take string from table
#1

I want to take string "ImeClana" from table http://prntscr.com/dc5uaj and to compare with one string which i insert in script..But i dont know how to take string from table good..So i did on this way but isnt very well

Quote:

format(nikoopet, sizeof(nikoopet), "NIKO");
format(query, sizeof(query), "SELECT `ImeClana` FROM `organizacije` WHERE `Slot` = '%d' AND `ImeOrganizacije` = '%s'", slot,ImeOrganizacije(PlayerInfo[para1][Lider]));
mysql_tquery(mysql, query, "", "");
cache_get_field_content(0, "ImeClana", niko);
if(strcmp(niko, nikoopet)) return SCMF(playerid, -1, ""CRVENA"[SA:RP]:"BELA"Neko se vec nalazi na slotu %d!",slot);

Reply
#2

try with
PHP код:
cache_get_field_name(0"ImeClana"niko50); 
Trebalo bi da radi
Reply
#3

If you're using the latest version of the plugin.
Код:
new 
    string[24];

cache_get_value_name(0, "ImeClana", string);
Reply
#4

Doesnt work,and i am using Mysql R39-3
Reply
#5

FIX:
Код:
new clanime[MAX_PLAYER_NAME], nikoopet[MAX_PLAYER_NAME] = "NIKO";
cache_get_field_content(0, "ImeClana", clanime);
if(strcmp(clanime,"nikoopet",true) == 0) return SCMF(playerid, -1, ""CRVENA"[SA:RP]:"BELA"Neko se vec nalazi na slotu %d!",slot);
Reply
#6

I work on this way,because cant on the way which you write here..But anyway thank you
This is on CMD:INVITE:
Quote:

format(query, sizeof(query), "SELECT `ImeClana` FROM `organizacije` WHERE `Slot` = '%d' AND `ImeOrganizacije` = '%s'", slot,ImeOrganizacije(PlayerInfo[para1][Lider]));
mysql_tquery(mysql, query, "ProveriSlot", "i", playerid);

This is on forward public:
Quote:

forward ProveriSlot(playerid);
public ProveriSlot(playerid)
{
new clanime[50], nikoopet[MAX_PLAYER_NAME] = "NIKO";
cache_get_field_content(0, "ImeClana", clanime);
SlotPrazan[playerid] = 1;
if(strcmp(clanime,nikoopet)) return SCM(playerid, -1, ""CRVENA"[SA:RP]:"BELA"Neko se vec nalazi na slotu!"),SlotPrazan[playerid] = 0;
return 1;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)