Updating MySQL plugin
#1

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();
Reply
#2

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);
Reply
#3

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);
Reply
#4

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.
Reply
#5

There is a tutorial written by AndreT https://sampforum.blast.hk/showthread.php?tid=337810
Reply
#6

Quote:
Originally Posted by alex9419
Посмотреть сообщение
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.
... Obviously didn't read topic. I have that already. Pay attention before you post.

Quote:
Originally Posted by iZN
Посмотреть сообщение
There is a tutorial written by AndreT https://sampforum.blast.hk/showthread.php?tid=337810
I don't wanna use cache at this moment. Sounds odd, but yeah.
Reply
#7

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?
Reply
#8

The MySQL connection is indeed successful, if it wasn't, it wouldn't be getting accounts out the database.
Reply
#9

If you're getting accounts out of the database this wouldn't be happening.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)