PDA

View Full Version : Loading MYSQL


Coox
21/06/2019, 09:07 PM
So I created a bunch of variables that load with mysql and it was going really fine until I created a new variable "JOB" and it cannot be loaded, and I don't know the reason. Please help.

cache_get_value_int(0, "JOB", pInfo[playerid][Job]);

MySQL log:
[23:04:01] [DEBUG] cache_get_value_name_int(0, "GOLD", 0x0372B7AC)
[23:04:01] [DEBUG] cache_get_value_name_int: assigned value: '200'
[23:04:01] [DEBUG] cache_get_value_name_int: return value: '1'
[23:04:01] [DEBUG] cache_get_value_name_int(0, "4", 0x0372B7B0)//this is supposed to be Job
[23:04:01] [ERROR] cache_get_value_name_int: field '4' not found

Mobtiesgangsa
21/06/2019, 09:36 PM
So I created a bunch of variables that load with mysql and it was going really fine until I created a new variable "JOB" and it cannot be loaded, and I don't know the reason. Please help.

ooouuu....? it sounds scary!!! >:(

:confused: i guess its not implemented in your MySQL Server :confused: , these errors come from your phpmyadmin, check if the column is existing go to your database press structure you can add-it manualy without droping your table by altering and adding the missing column, also check your pawn file are the variables are there as you wrote them in your editor.

P.S without code we cannot explain in a scripting form so you to understand

Coox
21/06/2019, 09:41 PM
ooouuu....? it sounds scary!!! >:(

:confused: i guess its not implemented in your MySQL Server :confused: , these errors come from your phpmyadmin, check if the column is existing go to your database press structure you can add-it manualy without droping your table by altering and adding the missing column, also check your pawn file are the variables are there as you wrote them in your editor.

P.S without code we cannot explain in a scripting form so you to understand

https://i.imgur.com/zR6eZFW.png

As you can see it is created. And it SAVES well i give the player an IN-GAME value and it saves pretty well. But everything seems to load except this.

Here is the loading code:
cache_set_active(pInfo[playerid][Player_Cache]);
cache_get_value_int(0, "ID", pInfo[playerid][ID]);
cache_get_value_int(0, "KILLS", pInfo[playerid][Kills]);
cache_get_value_int(0, "DEATHS", pInfo[playerid][Deaths]);
cache_get_value_int(0, "SCORE", pInfo[playerid][Score]);
cache_get_value_int(0, "CASH", pInfo[playerid][Cash]);
cache_get_value_int(0, "AGE", pInfo[playerid][Age]);
cache_get_value(0, "EMAIL", pInfo[playerid][Email], 24);
cache_get_value_int(0, "SKIN", pInfo[playerid][Skin]);
cache_get_value_int(0, "SEX", pInfo[playerid][Sex]);
cache_get_value_int(0, "STATE", pInfo[playerid][State]);
cache_get_value_int(0, "BANK", pInfo[playerid][Bank]);
cache_get_value_bool(0, "BANKACC", pInfo[playerid][BankAcc]);
cache_get_value_bool(0, "CARLICENSE", pInfo[playerid][CarLicense]);
cache_get_value_bool(0, "MOTOLICENSE", pInfo[playerid][MotoLicense]);
cache_get_value_bool(0, "TRUCKLICENSE", pInfo[playerid][TruckLicense]);
cache_get_value_bool(0, "BOATLICENSE", pInfo[playerid][BoatLicense]);
cache_get_value_int(0, "MATS", pInfo[playerid][Mats]);
cache_get_value_int(0, "GOLD", pInfo[playerid][Gold]);
cache_get_value_int(0, "JOB", pInfo[playerid][Job]);
cache_delete(pInfo[playerid][Player_Cache]);

Mobtiesgangsa
21/06/2019, 10:02 PM
can you change some of the setting aspecially for booleans in mysql bool's start with a value 1 variable type tinyint(1).

a Question: JOB column are there stored job ids?

Calisthenics
22/06/2019, 07:52 AM
Does your SELECT query list `JOB`?

Coox
22/06/2019, 11:30 AM
can you change some of the setting aspecially for booleans in mysql bool's start with a value 1 variable type tinyint(1).

a Question: JOB column are there stored job ids?

That is the variable which stores players current job.

Does your SELECT query list `JOB`?

I use SELECT * FROM `PLAYERS` WHERE USERNAME = '%s'

Calisthenics
22/06/2019, 11:57 AM
I have not come across with any bug related to overload macros. The error is given is like it tries to read from a column named "4". Try using the native instead:

cache_get_value_name_int(0, "JOB", pInfo[playerid][Job]);

Coox
22/06/2019, 12:01 PM
I have not come across with any bug related to overload macros. The error is given is like it tries to read from a column named "4". Try using the native instead:

cache_get_value_name_int(0, "JOB", pInfo[playerid][Job]);


Works fine, can you explain why did it read column '4' instead of JOB, at first I thought it was the ascii code of JOB, but I was wrong.