Mysql Query not working anymore, (Login System)
#1

Hey, thanks for taking at look at my problem .

So let's get down to it: My problem is that at some point while scripting my login loading system just stopped working, I don't know why. It's supposed to load:

pawn Код:
GetPlayerName(playerid, pname, sizeof(pname));
  format(stringsize, sizeof(stringsize), "SELECT * FROM "SQL_TABLE" WHERE Name = '%s'", pname);
  mysql_query(stringsize, -1, -1, RegistrationSystemConnection);
  mysql_store_result(RegistrationSystemConnection);
  new playerfilesplit[24][256], playerloadingarray[256];
  mysql_fetch_row_format(playerloadingarray,"|", RegistrationSystemConnection);
  split(playerloadingarray, playerfilesplit, '|');
  PlayerAccount[playerid][Pid] = strval(playerfilesplit[0]);
  PlayerAccount[playerid][Money] = strval(playerfilesplit[4]);
  PlayerAccount[playerid][AdminLevel] = strval(playerfilesplit[5]);
  PlayerAccount[playerid][Vip] = strval(playerfilesplit[6]);
  PlayerAccount[playerid][Skin] = strval(playerfilesplit[7]);
  PlayerAccount[playerid][Score] = strval(playerfilesplit[8]);
  PlayerAccount[playerid][Job] = strval(playerfilesplit[9]);
  PlayerAccount[playerid][Faction] = strval(playerfilesplit[10]);
  PlayerAccount[playerid][FactionRank] = strval(playerfilesplit[11]);
  PlayerAccount[playerid][Tester] = strval(playerfilesplit[12]);
  PlayerAccount[playerid][WeaponPackages] = strval(playerfilesplit[13]);
  PlayerAccount[playerid][DriverLic] = strval(playerfilesplit[14]);
  PlayerAccount[playerid][WeaponLic] = strval(playerfilesplit[15]);
  PlayerAccount[playerid][Developer] = strval(playerfilesplit[16]);
  PlayerAccount[playerid][Banned] = strval(playerfilesplit[17]);
  PlayerAccount[playerid][Achi1] = strval(playerfilesplit[18]);
  PlayerAccount[playerid][Achi2] = strval(playerfilesplit[19]);
  PlayerAccount[playerid][Achi3] = strval(playerfilesplit[20]);
  PlayerAccount[playerid][Achi4] = strval(playerfilesplit[21]);
  PlayerAccount[playerid][Achi5] = strval(playerfilesplit[22]);
  PlayerAccount[playerid][Achi6] = strval(playerfilesplit[23]);
However It does not run anymore it's like skipping this part, it runs the

pawn Код:
format(stringsize, sizeof(stringsize), "SELECT * FROM "SQL_TABLE" WHERE Name = '%s'", pname);
But it's like skipping the rest, I've never had this problem before, and can't remember when it happen and how so can't really fix it that way, now I'm forced to find a fix for it, I've been trying to find a solution but with no luck so far. Anybody here who mind helping?

Oh yea

Код:
[17:26:15] CMySQLHandler::Query(SELECT * FROM users WHERE Name = 'Tony_Salvati') - Successfully executed.

[17:26:15] >> mysql_store_result( Connection handle: 1 )

[17:26:15] CMySQLHandler::StoreResult() - Result was stored.

[17:26:20] >> mysql_query( Connection handle: 1 )
That's from the code above, but nothing else happens, well rest runs after that as it's supposed but just not the account system.
Reply
#2

Hi oliverrud,

Do any commands respond after you attempt to login? Or do they all say: SERVER: Uknown Command?

Cheers,

TJ
Reply
#3

Quote:
Originally Posted by TTJJ
Hi oliverrud,

Do any commands respond after you attempt to login? Or do they all say: SERVER: Uknown Command?

Cheers,

TJ
Well they do, haven't tested any but just went inside to test some and they did, however earlier today when this problem where here I had a few like 2 commands giving SERVER: Unknown Command.
Reply
#4

Thanks for the quick reply oliverrud,

This is a problem I have experienced a few times. You could try reducing the size of the variables you retrieve from the MySQL server. For example.

You get 24 strings, all 256 big:
Код:
playerfilesplit[24][256]
This is slightly unecessary and has caused me major issues in the past. Would you mind reducing it to 64?

Eg:
Код:
playerfilesplit[24][64]
Give it a try.

Cheers,

TJ
Reply
#5

Quote:
Originally Posted by TTJJ
Thanks for the quick reply oliverrud,

This is a problem I have experienced a few times. You could try reducing the size of the variables you retrieve from the MySQL server. For example.

You get 24 strings, all 256 big:
Код:
playerfilesplit[24][256]
This is slightly unecessary and has caused me major issues in the past. Would you mind reducing it to 64?

Eg:
Код:
playerfilesplit[24][64]
Give it a try.

Cheers,

TJ
What the f-.. I don't believe it, that was the error? Wow... I never thought that such would cause a problem. You rock! Thanks .
Reply
#6

Not a problem, Glad to help.

cheers,

TJ
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)