Mysql kinda crashes sometimes
#1

WORKING NOW! DELETE THREAD PLEASE
Reply
#2

Error stems from these lines:
pawn Код:
strcat(QueryFinal, "INSERT INTO `playerdata`(`Username`, `Password`, `AdminLevel`, `HelperLevel`, `Level`, `WaterBottle`, `Faction`, `Rank`, `Leader`, `Team`, `FishingNet`, `Boar`, `Note`, `Rope`, `Fruit`, `Boarmeat`, `FishingRod`, `Skin`, `Sex`, `Water`, `Fish`, `Heroin`, `FireMatches`, `FireWood`,");
    format(Query, sizeof(Query), "`Berry`, `Whiskey`, `Mask`, `Clothes`, `FishDone`, `R-Muted`, `Muted`, `aJailed`, `JailTime`, `RespectPoints`, `CoOwner`, `Skill`, `WalkieTalkie`, `APP`, `GunID`, `GUNMAT`, `GUNMAT2`, `GunID2`, `GunID3`, `GunID4`, `GunID5`, `Ammo`, `Ammo2`, `Ammo3`, `Ammo4`, `Ammo5`,");
    strcat(QueryFinal, Query);
    format(Query, sizeof(Query), "`Pos_X`, `Pos_Y`, `Pos_Z`, `Vip`, `WalkieBroken`, `ChoosenTeam`, `RelationShip`, `RelationWith`, `Interior`, `Warnings`, `Slots`, `SlotsFree`, `BackPack`, `Banned`, `IP`)");
    strcat(QueryFinal, Query);
    format(Query, sizeof(Query), "VALUES('%s',MD5('%s'),0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'%s')", ReturnPlayerName(playerid), password, IP); strcat(QueryFinal, Query);
Your MySQL log should keep track of the queries that have been submitted. Please count the fields or simplify your SQL (this is really crappy coding, set default values for the insert and let mysql handle it).
Reply
#3

DELETED
Reply
#4

DELETED
Reply
#5

try this by considering you have set default values in the table.

pawn Код:
public RegisterPlayer(playerid, password[])
{
    new Query[500],IP[20];
    GetPlayerIp(playerid, IP, 20);
    format(Query, sizeof(Query), "INSERT INTO `playerdata` (`Username`,`Password`,`IP`) VALUES ('%s',MD5('%s'),'%s')" ,ReturnPlayerName(playerid), password, IP);
    FirstSpawn[playerid] = 1;
    mysql_function_query(conn, Query, false, "OnQuerySend", "", playerid, password); // 67
    return 1;
}
Reply
#6

worked, thanks ikey
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)