[Tutorial] Easy MySQL Register/Login system!
#21

Nice way of setting up man, its a lot cleaner than the way i was doing it.

Just one thing. There isnt really much point to do this

Code:
SavePlayer(playerid)
{
	if(!PlayerLogged[playerid])
		return 0;

    	UserStats[playerid][Money] = GetPlayerMoney(playerid);
    

	CheckMySQL();
    
    	new string[256];
        format(string, sizeof(string), "UPDATE Users SET Password='%s', Admin='%d', Money='%d' WHERE Name='%s'", UserStats[playerid][Password], UserStats[playerid][Admin], UserStats[playerid][Money], UserStats[playerid][Name]);
    	mysql_query(string);
    	return 1;
}
Your much better off just updating what you need to update. Its not like their password ever changes while they are logged in unless your going to add a change password option or something.

My Way
Code:
SavePlayer(playerid)
{
	if(!PlayerLogged[playerid])
		return 0;

    	UserStats[playerid][Money] = GetPlayerMoney(playerid);
    

	CheckMySQL();
    
    	new string[256];
    	format(string, sizeof(string), "UPDATE `users` SET `admin`='%d', `money`='%d' WHERE `name`='%s'", UserStats[playerid][Admin], UserStats[playerid][Money], UserStats[playerid][Name]);
    	mysql_query(string);
    	return 1;
}
Just thought id let ya know =D
Reply


Messages In This Thread
Easy MySQL Register/Login system! (Includes every single step!) - by WackoX - 18.07.2010, 12:24
Re: Easy MySQL Register/Login system! - by Calgon - 18.07.2010, 13:08
Re: Easy MySQL Register/Login system! - by WackoX - 18.07.2010, 14:21
Re: Easy MySQL Register/Login system! - by Kar - 18.07.2010, 15:18
Re: Easy MySQL Register/Login system! - by Lewwy - 18.07.2010, 15:21
Re: Easy MySQL Register/Login system! - by WackoX - 18.07.2010, 16:01
Re: Easy MySQL Register/Login system! - by Lewwy - 18.07.2010, 16:25
Re: Easy MySQL Register/Login system! - by WackoX - 18.07.2010, 17:36
Re: Easy MySQL Register/Login system! - by [HiC]TheKiller - 18.07.2010, 19:32
Re: Easy MySQL Register/Login system! - by Lewwy - 18.07.2010, 19:48
Re: Easy MySQL Register/Login system! - by WackoX - 18.07.2010, 20:12
Re: Easy MySQL Register/Login system! - by [HiC]TheKiller - 19.07.2010, 06:28
Re: Easy MySQL Register/Login system! - by Scenario - 19.07.2010, 06:35
Re: Easy MySQL Register/Login system! - by Яσскѕтая - 21.07.2010, 11:17
Re: Easy MySQL Register/Login system! - by Gforcez - 21.07.2010, 14:31
Re: Easy MySQL Register/Login system! - by Luis_Leone - 31.07.2010, 22:07
Re: Easy MySQL Register/Login system! - by WackoX - 02.08.2010, 16:44
Re: Easy MySQL Register/Login system! - by RealLifeRP - 03.08.2010, 04:41
Re: Easy MySQL Register/Login system! - by Vince - 03.08.2010, 12:37
Re: Easy MySQL Register/Login system! - by WackoX - 03.08.2010, 17:16
Re: Easy MySQL Register/Login system! - by Martin_Santiago - 05.08.2010, 07:39
Re: Easy MySQL Register/Login system! - by WackoX - 05.08.2010, 08:45
Re: Easy MySQL Register/Login system! - by Kyle - 09.08.2010, 19:34
Re: Easy MySQL Register/Login system! - by playbox12 - 17.08.2010, 20:23
Re: Easy MySQL Register/Login system! - by KotoK - 26.12.2010, 21:27
Re: Easy MySQL Register/Login system! - by Anthonyx3' - 08.01.2011, 20:08
Re: Easy MySQL Register/Login system! - by [MWR]Blood - 15.01.2011, 14:26
Re: Easy MySQL Register/Login system! - by Anthonyx3' - 15.01.2011, 14:45
Re: Easy MySQL Register/Login system! - by THE_KNOWN - 15.01.2011, 15:27
Re: Easy MySQL Register/Login system! - by THE_KNOWN - 21.01.2011, 04:35
Re: Easy MySQL Register/Login system! - by HyperZ - 31.01.2011, 07:31
Re: Easy MySQL Register/Login system! - by jesse237 - 05.02.2011, 13:00
Re: Easy MySQL Register/Login system! - by TheLazySloth - 11.10.2011, 12:04
Re : Easy MySQL Register/Login system! - by falor - 22.02.2012, 03:29
Re: Easy MySQL Register/Login system! - by ArmyOps - 22.02.2012, 10:02
Re: Easy MySQL Register/Login system! - by swindle69 - 22.02.2012, 23:43
Respuesta: Easy MySQL Register/Login system! - by ValenRatti - 26.02.2012, 07:48
Re: Easy MySQL Register/Login system! - by x96664 - 19.07.2012, 13:33
Re: Easy MySQL Register/Login system! - by Yashas - 04.12.2012, 00:22
Re: Easy MySQL Register/Login system! - by x96664 - 04.12.2012, 15:00
Re: Easy MySQL Register/Login system! - by Johnson_boy - 05.12.2012, 14:36
Re : Easy MySQL Register/Login system! - by [HRD]Mar1 - 06.12.2012, 12:39
Re: Easy MySQL Register/Login system! - by SAMPHacker - 23.01.2013, 16:20
Re: Easy MySQL Register/Login system! - by Yashas - 05.02.2013, 12:56
Re: Easy MySQL Register/Login system! - by Kiweeh - 30.05.2013, 13:37
Re: Easy MySQL Register/Login system! - by Mr.R - 26.06.2013, 19:19
Re: Easy MySQL Register/Login system! - by Vince - 26.06.2013, 20:52
Re : Easy MySQL Register/Login system! - by TomYeager - 17.08.2013, 22:15
Re: Easy MySQL Register/Login system! - by Dejan12345 - 19.07.2016, 12:14
Re: Easy MySQL Register/Login system! - by Melktert - 11.04.2017, 19:25
Re: Easy MySQL Register/Login system! - by FatihBey - 11.07.2017, 19:16
Re: Easy MySQL Register/Login system! - by coool - 12.07.2017, 07:36

Forum Jump:


Users browsing this thread: 1 Guest(s)