Updating MySQL plugin -
EliteApple - 02.02.2014
I' have an old outdated plugin that I been using for awhile now, I decided to update to BlueG.
However, fetching rows aren't right and I'm not sure why, It's 3am in the morning and I have no clue.
pawn Код:
//no MySQL above the bottom line, besides the account selecting, which works.
mysql_fetch_field_row(DataString, "Level"); // Level
PlayerInfo[playerid][pLevel] = strval(DataString);
mysql_fetch_field_row(DataString, "Admin"); // Administrator
PlayerInfo[playerid][pAdministrator] = strval(DataString);
//-- and alot more of these fetching
mysql_free_result();
Re: Updating MySQL plugin -
alex9419 - 02.02.2014
Are you storing the result (i.e mysql_store_result())?
Also, the mysql_fetch_field_row (or mysql_get_field) parameters are as follows: columnname, destination, i.e
pawn Код:
mysql_get_field("Admin", DataString);
Re: Updating MySQL plugin -
EliteApple - 02.02.2014
Other plugin wasn't storing result after fetching, however their is mysql store if account is there.
pawn Код:
format( Query, sizeof( Query ), "SELECT * FROM `Accounts` WHERE `UserID` = '%d'", PlayerInfo[playerid][pDatabaseID] );
if(mysql_query( Query ))
{
mysql_store_result();
mysql_get_field doesn't exist. This is R6.
And yes;
native mysql_fetch_field_row(string[],const fieldname[],connectionHandle = 1);
Re: Updating MySQL plugin -
alex9419 - 02.02.2014
I would recommend updating to the latest version of the plugin, then.
https://github.com/pBlueG/SA-MP-MySQL/releases/tag/R35
EDIT:
pawn Код:
new result[50];
mysql_fetch_field_row(result,"username");
//or if you use macro
mysql_get_field("username",result);
There you go.
Re: Updating MySQL plugin -
iZN - 02.02.2014
There is a tutorial written by AndreT
https://sampforum.blast.hk/showthread.php?tid=337810
Re: Updating MySQL plugin -
EliteApple - 02.02.2014
Quote:
Originally Posted by alex9419
|
... Obviously didn't read topic. I have that already. Pay attention before you post.
Quote:
Originally Posted by iZN
|
I don't wanna use cache at this moment. Sounds odd, but yeah.
Re: Updating MySQL plugin -
alex9419 - 02.02.2014
Updating to the r34 of the BlueG plugin is still recommended, you won't be forced to use the caching functionality.
Are you actually getting the results from the database? Does other queries like INSERT or UPDATE function? Have you double checked that the connection is actually established?
pawn Код:
mysql_connect( const host[], const user[], const database[], const password[] ) *
Did you perhaps mistake the order of parameters in the mysql_connect function when you switched?
Re: Updating MySQL plugin -
EliteApple - 03.02.2014
The MySQL connection is indeed successful, if it wasn't, it wouldn't be getting accounts out the database.
Re: Updating MySQL plugin -
alex9419 - 03.02.2014
If you're getting accounts out of the database this wouldn't be happening.