[POMOC] MYSQL Error

Započeo Almedin100, Maj 13, 2012, 15:51:50 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: 0
Detaljan opis problema:
eto error:
C:\Users\Desktop\mysql\.PWN(6787) : error 032: array index out of bounds (variable "pName")
C:\Users\Desktop\mysql\.PWN(6787) : warning 215: expression has no effect
C:\Users\Desktop\mysql\.PWN(6787) : error 001: expected token: ";", but found "]"
C:\Users\Desktop\mysql\.PWN(6787) : error 029: invalid expression, assumed zero
C:\Users\Desktop\mysql\.PWN(6787) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664     Copyright (c) 1997-2006, ITB CompuPhase

Dio skripte:
Public OnPlayerConnect(playerid)
{


    GetPlayerName(playerid, pName, sizeof(pName));
    pName[24], escpname[24];
    mysql_real_escape_string(pName, escpname);
format(Query, sizeof(Query), "SELECT * FROM `RACUNI` WHERE `user` = '%s'", escpname);  playername is the player
    mysql_query(Query);
     mysql_store_result();
    if(mysql_num_rows() != 0){return 1;}
    if(!mysql_num_rows()){ format(Query, sizeof(Query), "INSERT INTO `RACUNI` (`user`, `score`,) VALUES ('%s','0' )", escpname);
            mysql_query(Query);
            mysql_store_result();
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):

Linija 6787 je:  pName[24], escpname[24];
Poslednja Izmena: Maj 13, 2012, 15:52:18 POSLE PODNE od Almedin100

Zna neko rješenje, već su dva dana prošla?

Trebalo bi ovo valjat

public OnPlayerConnect(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(Query, sizeof(Query), "SELECT * FROM `RACUNI` WHERE `user` = '%s'", pName);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows() != 0)
{
return 1;
}
else
{
format(Query, sizeof(Query), "INSERT INTO `RACUNI` (`user`, `score`) VALUES ('%s','0')", pName);
mysql_query(Query);
mysql_store_result();
}
return 1;
}