MySQL - What are rows and fields?
#1

Код:
cache_get_field_content_int(row, const field_name[], connectionHandle = 1)
The above line of code is what I am using multiple times. Below is part of my code:

Код:
PlayerInfo[playerid][pSpawn] = cache_get_field_content_int(0, "Spawn");
PlayerInfo[playerid][pGender] = cache_get_field_content_int(0, "Gender");
PlayerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level");
PlayerInfo[playerid][pEntered] = cache_get_field_content_int(0, "Entered");
PlayerInfo[playerid][pMinutes] = cache_get_field_content_int(0, "Minutes");
PlayerInfo[playerid][pTMinutes] = cache_get_field_content_int(0, "TMinutes");
PlayerInfo[playerid][pHours] = cache_get_field_content_int(0, "Hours");
PlayerInfo[playerid][pAge] = cache_get_field_content_int(0, "Age");
PlayerInfo[playerid][pADMute] = cache_get_field_content_int(0, "ADMute");
PlayerInfo[playerid][pModel] = cache_get_field_content_int(0, "Model");
PlayerInfo[playerid][pModel1] = cache_get_field_content_int(0, "Model1");
PlayerInfo[playerid][pModel2] = cache_get_field_content_int(0, "Model2");
PlayerInfo[playerid][pModel3] = cache_get_field_content_int(0, "Model3");
PlayerInfo[playerid][pMapper] = cache_get_field_content_int(0, "Mapper");
PlayerInfo[playerid][pBanned] = cache_get_field_content_int(0, "Banned");
PlayerInfo[playerid][pNumber] = cache_get_field_content_int(0, "Number");
PlayerInfo[playerid][pKill] = cache_get_field_content_int(0, "Kill");
PlayerInfo[playerid][pDeath] = cache_get_field_content_int(0, "Death");
PlayerInfo[playerid][pInt] = cache_get_field_content_int(0, "Interior");
PlayerInfo[playerid][pVW] = cache_get_field_content_int(0, "Virtual World");
I have over 150 lines of the above code for all my different variables and strings. I set the row to 0 at first not knowing what it was, but since the code is not loading, I think it has something to do with that. Can someone help?


EDIT:
Also, is this the most efficient way of saving everything?

Код:
mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `VehVW`=%d, `WalkStyle`=%d, `Fac`=%d, `FacRank`=%d, `FacLeader`=%d, 'FacDiv'=%d, 'FacDivLeader'=%d, 'FacDuty'=%d, 'Weapon[0]'=%d, 'Weapon[1]'=%d WHERE `ID`=%d",
PlayerInfo[playerid][pVehVW], PlayerInfo[playerid][pWalkStyle], PlayerInfo[playerid][pFac], PlayerInfo[playerid][pFacRank], PlayerInfo[playerid][pFacLeader], PlayerInfo[playerid][pFacDiv], PlayerInfo[playerid][pFacDivLeader], PlayerInfo[playerid][pFacDuty], PlayerInfo[playerid][pWeapon][0], PlayerInfo[playerid][pWeapon][1], PlayerInfo[playerid][ID]);
mysql_tquery(mysql, query, "", "");
	
mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `Weapon[2]`=%d, `Weapon[3]`=%d, `Weapon[4]`=%d, `Weapon[5]`=%d, `Weapon[6]`=%d, 'Weapon[7]'=%d, 'Weapon[8]'=%d, 'Weapon[9]'=%d, 'Weapon[10]'=%d, 'Weapon[11]'=%d, 'Weapon[12]'=%d WHERE `ID`=%d",
PlayerInfo[playerid][pWeapon][2], PlayerInfo[playerid][pWeapon][3], PlayerInfo[playerid][pWeapon][4], PlayerInfo[playerid][pWeapon][5], PlayerInfo[playerid][pWeapon][6], PlayerInfo[playerid][pWeapon][7], PlayerInfo[playerid][pWeapon][8], PlayerInfo[playerid][pWeapon][9], PlayerInfo[playerid][pWeapon][10], PlayerInfo[playerid][pWeapon][11], PlayerInfo[playerid][pWeapon][12], PlayerInfo[playerid][ID]);
mysql_tquery(mysql, query, "", "");
Again, I use the code above multiple times as it has to cover all my variables.
Reply


Messages In This Thread
MySQL - What are rows and fields? - by Ciarannn - 28.04.2015, 19:46
Re: MySQL - What are rows and fields? - by Konstantinos - 28.04.2015, 19:53
Re: MySQL - What are rows and fields? - by Ciarannn - 28.04.2015, 20:01
Re: MySQL - What are rows and fields? - by Konstantinos - 28.04.2015, 20:04
Re: MySQL - What are rows and fields? - by Ciarannn - 28.04.2015, 20:06
Re: MySQL - What are rows and fields? - by Konstantinos - 28.04.2015, 20:09
Re: MySQL - What are rows and fields? - by Ciarannn - 28.04.2015, 20:30
Re: MySQL - What are rows and fields? - by Konstantinos - 28.04.2015, 20:35
Re: MySQL - What are rows and fields? - by Ciarannn - 28.04.2015, 20:37
Re: MySQL - What are rows and fields? - by Konstantinos - 28.04.2015, 20:40

Forum Jump:


Users browsing this thread: 1 Guest(s)