MySQL
#1

Код:
SaveAchievements(playerid)
{
	new _query[74];
	
	mysql_format(handle, _query, sizeof(_query), "DELETE FROM `achievements` WHERE `Username` = %s",  pInfo[playerid][pUsername]);
	mysql_tquery(handle, _query);

	for(new i; i<sizeof(AchievementInfo); i++)
	{
		if(pAch[playerid][E_PlayerAchievements:i])
		{
			mysql_format(handle, _query, sizeof(_query), "INSERT INTO `achievements` (`AchID`) VALUES (%d)", i);
			mysql_tquery(handle, _query);
		}
	}

	return 1;
}
So the thing is it does not work correctly. It saves the achievement into the "AccountID". But the value saving into "AccountID" is the playerid in the game. Like, you're number on /pm [id]. I want it to get the accountid from the table "accounts".


Like, I got an achievement. My Username is DarkMythHunter and my id is 1. I would like the achievement data to be saved into mysql. I want to get the ID, and save it in achievement table. Same for username.


The table achievement have 3 row;

AccountID
Username
AchID


If user DarkMythHunter got an achievement, then his ID in the database, not the ID ingame will be into "AccountID", the username will be under "Username".

Im not that good explaining this one, sorry. Thanks for those who will help me out.
Reply


Messages In This Thread
MySQL - by DarkMythHunter - 30.08.2018, 13:15
Re: MySQL - by Shinja - 30.08.2018, 15:04
Re: MySQL - by Eoussama - 30.08.2018, 15:21
Re: MySQL - by Calisthenics - 30.08.2018, 15:26
Re: MySQL - by DarkMythHunter - 01.09.2018, 09:20

Forum Jump:


Users browsing this thread: 1 Guest(s)