MySQL R7 from MySQL R6/R5 - 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)
+--- Thread: MySQL R7 from MySQL R6/R5 (
/showthread.php?tid=361151)
MySQL R7 from MySQL R6/R5 -
Shockey HD - 20.07.2012
I recently converted over from R5/R6 to R7, and i immediately noticed i can no longer use mysql_query ( Makes me sound newbie, but oh well. I'm here to learn. )
Now; I'm a tad confusing on what to convert mysql_query to, and how i will do it; So ill post some scripts hoping you guys can take a look at it see and help me out.
Код:
public OnGameModeInit()
{
SetGameModeText(REVISION);
mysql_connect(mysql_host, mysql_user, mysql_database, mysql_password);
mysql_function_query(dbHandle,"CREATE TABLE IF NOT EXISTS playerdata(user VARCHAR(24), password VARCHAR(41), level INT(20), money INT(20), IP VARCHAR(16), admin INT(20), bank INT(20))");
UsePlayerPedAnims();
mysql_debug(1);
DisableInteriorEnterExits();
return 1;
}
Код:
format(query, sizeof(query), "SELECT IP FROM `playerdata` WHERE user = '%s' LIMIT 1", pname);
mysql_query(query);
Thank's for the help.
Re: MySQL R7 from MySQL R6/R5 -
iggy1 - 20.07.2012
There is a section in the tutorial from the following link about converting to use threaded queries. You can't use the old method with R7, all queries must be threaded.
https://sampforum.blast.hk/showthread.php?tid=337810
Re: MySQL R7 from MySQL R6/R5 -
namespace - 20.07.2012
Quote:
Originally Posted by iggy1
|
wtf.. that sucks man.. i liked the old style better is it just me? everyone used to mysql_query imo
i dont like learning new stuff about something i already know :P
Re: MySQL R7 from MySQL R6/R5 -
iggy1 - 20.07.2012
I feel the opposite, when new tech comes out you should try to use it. The performance benefit from threaded queries is enough to make me want to use them.
Your not learning new stuff you already know, your learning new stuff you didn't/don't know