Speicherfehler (MySQL)

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo liebe Community, mein Problem ist das perso und geschlecht in der Datenbank nicht gespeichert werden. Warum weiß ich leider nicht, deswegen habe ich gehofft ihr könntet mal drüber schauen.



    Mein Code:
    savePlayer(playerid)
    {
    if(sInfo[playerid][eingeloggt]==0)return 1;
    //Speichern (Level,Geld)
    new query[256];
    format(query,sizeof(query),"UPDATE user SET level='%i',money='%i',adminlevel='%i',fraktion='%i',skin='%i' WHERE id='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][adminlevel],sInfo[playerid][fraktion],sInfo[playerid][skin],sInfo[playerid][pid]);
    mysql_function_query(dbhandle,query,false,"","");
    format(query,sizeof(query),"UPDATE user SET gun1='%i',gun2='%i',gun3='%i',gun4='%i',gun5='%i',gun6='%i' WHERE id='%i'",sInfo[playerid][gun1],sInfo[playerid][gun2],sInfo[playerid][gun3],sInfo[playerid][gun4],sInfo[playerid][gun5],sInfo[playerid][gun6],sInfo[playerid][pid]);
    mysql_function_query(dbhandle,query,false,"","");
    format(query,sizeof(query),"UPDATE user SET guna1='%i',guna2='%i',guna3='%i',guna4='%i',guna5='%i',guna6='%i' WHERE id='%i'",sInfo[playerid][guna1],sInfo[playerid][guna2],sInfo[playerid][guna3],sInfo[playerid][guna4],sInfo[playerid][guna5],sInfo[playerid][guna6],sInfo[playerid][pid]);
    mysql_function_query(dbhandle,query,false,"","");
    format(query,sizeof(query),"UPDATE user SET banned='%i',pwarn='%i',crimes='%i',geschlecht='%i' WHERE id='%i'",sInfo[playerid][banned],sInfo[playerid][pwarn],sInfo[playerid][crimes],sInfo[playerid][geschlecht],sInfo[playerid][pid]);
    mysql_function_query(dbhandle,query,false,"","");
    format(query,sizeof(query),"UPDATE user SET perso='%i',gbdatum='%i',bmoney='%i' WHERE id='%i'",sInfo[playerid][perso],sInfo[playerid][gbdatum],sInfo[playerid][bmoney],sInfo[playerid][pid]);
    mysql_function_query(dbhandle,query,false,"","");
    //banned='%i'
    return 1;
    }


    resetPlayer(playerid)
    {
    sInfo[playerid][level]=0;
    sInfo[playerid][eingeloggt]=0;
    sInfo[playerid][pid]=0;
    sInfo[playerid][adminlevel]=0;
    sInfo[playerid][fraktion]=0;
    sInfo[playerid][skin]=0;
    sInfo[playerid][dienst]=0;
    sInfo[playerid][aduty]=0;
    sInfo[playerid][cuffed]=0;
    sInfo[playerid][registrierung]=0;
    sInfo[playerid][banned]=0;
    sInfo[playerid][supcar]=0;
    sInfo[playerid][realchat]=0;
    sInfo[playerid][tooc]=0;
    sInfo[playerid][bigear]=0;
    sInfo[playerid][muted]=0;
    sInfo[playerid][gun1]=0;
    sInfo[playerid][guna1]=0;
    sInfo[playerid][gun2]=0;
    sInfo[playerid][guna2]=0;
    sInfo[playerid][gun3]=0;
    sInfo[playerid][guna3]=0;
    sInfo[playerid][gun4]=0;
    sInfo[playerid][guna4]=0;
    sInfo[playerid][gun5]=0;
    sInfo[playerid][guna5]=0;
    sInfo[playerid][gun6]=0;
    sInfo[playerid][guna6]=0;
    sInfo[playerid][pwarn]=0;
    sInfo[playerid][crimes]=0;
    sInfo[playerid][friedhof] = 0;
    sInfo[playerid][perso] = 0;
    sInfo[playerid][geschlecht] = 0;
    sInfo[playerid][gbdatum] = 0;
    sInfo[playerid][bmoney] = 0;
    APerso[playerid] = 0;
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    //if(GetPVarInt(playerid,"loggedin")==1)
    //{
    //SpielerSpeichern(playerid);
    //}
    for(new i=0; i<sizeof(cInfo); i++)
    {
    if(cInfo[i][id_x]==0)continue;
    if(cInfo[i][besitzer]!=sInfo[playerid][pid])continue;
    GetVehiclePos(cInfo[i][id_x],cInfo[i][c_x],cInfo[i][c_y],cInfo[i][c_z]);
    GetVehicleZAngle(cInfo[i][id_x],cInfo[i][c_r]);
    GetVehicleColor(cInfo[i][id_x], cInfo[i][vcolor1], cInfo[i][vcolor2]);
    cInfo[i][tuning1]=GetVehicleComponentInSlot(cInfo[i][id_x], 0);
    cInfo[i][tuning2]=GetVehicleComponentInSlot(cInfo[i][id_x], 1);
    cInfo[i][tuning3]=GetVehicleComponentInSlot(cInfo[i][id_x], 2);
    cInfo[i][tuning4]=GetVehicleComponentInSlot(cInfo[i][id_x], 3);
    cInfo[i][tuning5]=GetVehicleComponentInSlot(cInfo[i][id_x], 4);
    cInfo[i][tuning6]=GetVehicleComponentInSlot(cInfo[i][id_x], 5);
    cInfo[i][tuning7]=GetVehicleComponentInSlot(cInfo[i][id_x], 6);
    cInfo[i][tuning8]=GetVehicleComponentInSlot(cInfo[i][id_x], 7);
    cInfo[i][tuning9]=GetVehicleComponentInSlot(cInfo[i][id_x], 8);
    cInfo[i][tuning10]=GetVehicleComponentInSlot(cInfo[i][id_x], 9);
    cInfo[i][tuning11]=GetVehicleComponentInSlot(cInfo[i][id_x], 10);
    cInfo[i][tuning12]=GetVehicleComponentInSlot(cInfo[i][id_x], 11);
    cInfo[i][tuning13]=GetVehicleComponentInSlot(cInfo[i][id_x], 12);
    cInfo[i][tuning14]=GetVehicleComponentInSlot(cInfo[i][id_x], 13);
    new query[256];
    format(query,sizeof(query),"UPDATE autos SET x='%f',y='%f',z='%f',r='%f',color1='%i',color2='%i',lock='%i' WHERE id='%i'",cInfo[i][c_x],cInfo[i][c_y],cInfo[i][c_z],cInfo[i][c_r],cInfo[i][vcolor1],cInfo[i][vcolor2],cInfo[i][lock],cInfo[i][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    format(query,sizeof(query),"UPDATE autos SET tuning1='%i',tuning2='%i',tuning3='%i',tuning4='%i',tuning5='%i',tuning6='%i',tuning7='%i' WHERE id='%i'",cInfo[i][tuning1],cInfo[i][tuning2],cInfo[i][tuning3],cInfo[i][tuning4],cInfo[i][tuning5],cInfo[i][tuning6],cInfo[i][tuning7],cInfo[i][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    format(query,sizeof(query),"UPDATE autos SET tuning8='%i',tuning9='%i',tuning10='%i',tuning11='%i',tuning12='%i',tuning13='%i',tuning14='%i' WHERE id='%i'",cInfo[i][tuning8],cInfo[i][tuning9],cInfo[i][tuning10],cInfo[i][tuning11],cInfo[i][tuning12],cInfo[i][tuning13],cInfo[i][tuning14],cInfo[i][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    DestroyVehicle(cInfo[i][id_x]);
    cInfo[i][id_x]=0;
    }
    if(sInfo[playerid][supcar]==1)
    {
    sInfo[playerid][supcar] = 0;
    DestroyVehicle(Supcar[playerid]);
    }
    GetPlayerWeapons(playerid);
    savePlayer(playerid);
    resetPlayer(playerid);
    KillTimer(CarTimer[playerid]);
    return 1;
    }



    In der Datenbank sind alle Tabeln erstellt.





    Mit freundlichen Grüßen,
    DexterA1

  • Oha hab was in der MySQL Log entdeckt aber wie kann ich das reparieren?


    [02:10:16] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock='0' WHERE id='2'' at line 1
    [02:10:16] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock='1' WHERE id='3'' at line 1
    [02:10:16] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lock='0' WHERE id='4'' at line 1
    [02:10:16] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pwarn' in 'field list'
    [02:10:16] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'perso' in 'field list'
    [02:10:59] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pwarn")
    [02:10:59] [WARNING] CMySQLResult::GetRowDataByName - field not found ("crimes")
    [02:10:59] [WARNING] CMySQLResult::GetRowDataByName - field not found ("perso")
    [02:10:59] [WARNING] CMySQLResult::GetRowDataByName - field not found ("gbdatum")
    [02:10:59] [WARNING] CMySQLResult::GetRowDataByName - field not found ("bmoney")
    [02:11:53] [WARNING] CMySQLResult::GetRowDataByName - field not found ("pwarn")
    [02:11:53] [WARNING] CMySQLResult::GetRowDataByName - field not found ("crimes")
    [02:11:53] [WARNING] CMySQLResult::GetRowDataByName - field not found ("perso")
    [02:11:53] [WARNING] CMySQLResult::GetRowDataByName - field not found ("gbdatum")
    [02:11:53] [WARNING] CMySQLResult::GetRowDataByName - field not found ("bmoney")
    [02:12:09] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pwarn' in 'field list'
    [02:12:09] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'perso' in 'field list'
    [02:13:31] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pwarn' in 'field list'
    [02:13:31] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'gbdatum' in 'field list'
    [02:14:11] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pwarn' in 'field list'
    [02:14:11] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'gbdatum' in 'field list'
    [02:15:13] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'pwarn' in 'field list'
    [02:15:13] [ERROR] CMySQLQuery::Execute[()] - (error #1054) Unknown column 'gbdatum' in 'field list'