Problem oko sacuvavanja drzava,spol,godina u mysql


Započeo Kicony, Avgust 12, 2018, 21:28:54 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning):Ovako imam problem oko sacuvavanja drzave,email,spol,godina u mysql ja sam napravio register system koje sve radi ucitava dialoge i textdrawe sve extra ali imam problem trebami sacuvati drzavu spol i godine i email ali nez kako to da napravim

code:public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
   {
       case 0:
       {
           if(!response) return Kick(playerid);
           mysql_format(konekcija, Query,sizeof(Query), " SELECT * FROM `korisnici` WHERE ImeKorisnika = '%e' AND Sifra = '%e'", RPIme(playerid), inputtext);
           mysql_function_query(konekcija, Query, false, "LogirajKorisnika", "ds", playerid, inputtext);
      }
      case 1:
      {
          if(!response) SetTimerEx("kick",1000,false,"d",playerid);
          if(response)
          {

              new god = strval(inputtext);
              if(god < 1)
                if(god > MAX_GOD)
            PlayerInfo[playerid][pGodine] = god;
             new gstring[264];
                format(gstring,sizeof(gstring),"Molimo vas upisite koliko imate godina");
                ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT, "Registrazija", gstring, "Dalje","Odustani");
              strmid( PlayerInfo[ playerid ][ pDrzava ], inputtext, 0, strlen( inputtext ), 34 );
              PlayerTextDrawSetString( playerid, RegisterTD[playerid][11], inputtext );
              SelectTextDraw( playerid, 0xAA3333AA );
         }
         return 1;
      }
      case 2:
      {
           if(!response) SetTimerEx("kick",1000,false,"d",playerid);
          if(response)
          {
              switch(listitem)
              {
                    case 0:
                  {
                      PlayerInfo[playerid][pDrzava] = 0;
                  strmid( PlayerInfo[ playerid ][ pDrzava ], inputtext, 0, strlen( inputtext ), 34 );
                  PlayerTextDrawSetString( playerid, RegisterTD[playerid][13], inputtext );
                  SelectTextDraw( playerid, 0xAA3333AA );
                  return 1;
               }
               case 1:
                  {
                      PlayerInfo[playerid][pDrzava] = 1;
                      strmid( PlayerInfo[ playerid ][ pDrzava ], inputtext, 0, strlen( inputtext ), 34 );
                  PlayerTextDrawSetString( playerid, RegisterTD[playerid][13], inputtext );
                  SelectTextDraw( playerid, 0xAA3333AA );
                  return 1;
               }
               case 2:
                  {
                      PlayerInfo[playerid][pDrzava] = 2;
                      strmid( PlayerInfo[ playerid ][ pDrzava ], inputtext, 0, strlen( inputtext ), 34 );
                  PlayerTextDrawSetString( playerid, RegisterTD[playerid][13], inputtext );
                  SelectTextDraw( playerid, 0xAA3333AA );
                  return 1;
               }
              }
         }
         return 1;
      }
      case 3:
      {
          if(!response) SetTimerEx("kick",1000,false,"d",playerid);
          if(response)
          {
              switch(listitem)
              {
                    case 0:
                  {
                        new dtxt[24],stxt[24];
                      PlayerInfo[playerid][pSpol] = 1;
                      if(PlayerInfo[playerid][pDrzava] == 0) { dtxt = "Hrvatska";
                  }else if(PlayerInfo[playerid][pDrzava] == 1) { dtxt = "Srbija";
                        }else if(PlayerInfo[playerid][pDrzava] == 2) { dtxt = "BIH"; }
                        if(PlayerInfo[playerid][pSpol] == 1) { stxt = "Musko";
                  }else if(PlayerInfo[playerid][pSpol] == 2) { stxt = "Zensko"; }
                  strmid( PlayerInfo[ playerid ][ pSpol ], inputtext, 0, strlen( inputtext ), 34 );
                  PlayerTextDrawSetString( playerid, RegisterTD[playerid][9], inputtext );
                    SelectTextDraw( playerid, 0xAA3333AA );
                  return 1;
               }
               case 1:
               {
                   new dtxt[24],stxt[24];
                   PlayerInfo[playerid][pSpol] = 2;
                   if(PlayerInfo[playerid][pDrzava] == 0) { dtxt = "Hrvatska";
                  }else if(PlayerInfo[playerid][pDrzava] == 1) { dtxt = "Srbija";
                        }else if(PlayerInfo[playerid][pDrzava] == 2) { dtxt = "BIH"; }
                        if(PlayerInfo[playerid][pSpol] == 1) { stxt = "Musko";
                  }else if(PlayerInfo[playerid][pSpol] == 2) { stxt = "Zensko"; }
                  strmid( PlayerInfo[ playerid ][ pSpol ], inputtext, 0, strlen( inputtext ), 34 );
                  PlayerTextDrawSetString( playerid, RegisterTD[playerid][9], inputtext );
                     SelectTextDraw( playerid, 0xAA3333AA );
                     return 1;
               }
            }
         }
          return 1;
      }
      case 4:
      {
          new IP[50];
          GetPlayerIp(playerid, IP, sizeof(IP));
          if(!response) return Kick(playerid);
          mysql_format(konekcija, Query,sizeof(Query), "INSERT INTO `korisnici` (ImeKorisnika, Sifra, Novac, Level, Admin,  IP, Drzava, Godine, Spol) VALUES('%e', '%e', 5000, 1, 0, '%e','e','e','e')", RPIme(playerid), inputtext, IP, inputtext, PlayerInfo[playerid][pDrzava], PlayerInfo[playerid][pSpol]);
            mysql_function_query(konekcija, Query, false, "OnQueryFinish", "s", Query);
         SpawnPlayer(playerid);
      }
      case 5:
      {
              new mailstring = strfind( inputtext, "@", true), tackastring = strfind( inputtext, ".", true );
               if( mailstring == -1 || tackastring == -1) {
              ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Mail", "U prazni prostor ispod unesite vasu e-mail adresu.\nE-mail adresa ce nam posluziti u vracanju vasih passworda.(Bez maila nema vracanja passworda)", "Unos", "Izlaz");
            }
            else
            {
               strmid( PlayerInfo[ playerid ][ pEmail ], inputtext, 0, strlen( inputtext ), 34 );
               PlayerTextDrawSetString( playerid, RegisterTD[playerid][7], inputtext );
                  SelectTextDraw( playerid, 0xAA3333AA );
            }
         }
        case 6:
      {
                    mysql_store_result();
               if(mysql_num_rows(konekcija) != 1)
               {
               }
               mysql_free_result();
               PlayerTextDrawSetString( playerid, RegisterTD[playerid][5], inputtext );
                  SelectTextDraw( playerid, 0xAA3333AA );
      }
   }
   if(dialogid == 7)
   {
       if(!response) return Kick(playerid);
       if(response)
       {
         SpawnPlayer(playerid);
       }
   }
   if(dialogid == 8)
   {
       new string[264];
       if(!response) return Kick(playerid);
       if(response)
       {
           format(string, sizeof(string), "Login %s  !\nPokusaj ponovo da se logiras!!", RPIme(playerid));
          ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PASSWORD, "Prijava", string, "Prijavi se", "Odustani");
       }
   }
   return 1;
}
proud owner of Balkan Expiriance Community

Mrzi me da citam ovo, daj mysql_log

Mnogo imaš ti još da jedeš kačamak.
skrr
Moj tutorijali: Bazilion indent warninga
WORK? : Smart Project 1.2 , Leskovacki Detmec, Rodjendanski  server


Penzionisani balkanski samp kripter


[15:15:55] [ERROR] CMySQLQuery::Execute[OnQueryFinish(s)] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`Drzava` =66, `Godine` =0, `Spol` =77' at line 1
[21:09:08] [ERROR] CMySQLQuery::Execute[OnQueryFinish(s)] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`Drzava` =0, `Godine` =0, `Spol` =0' at line 1
eto ga
proud owner of Balkan Expiriance Community

Citat: Kicony poslato Avgust 12, 2018, 23:46:24 POSLE PODNE
[15:15:55] [ERROR] CMySQLQuery::Execute[OnQueryFinish(s)] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`Drzava` =66, `Godine` =0, `Spol` =77' at line 1
[21:09:08] [ERROR] CMySQLQuery::Execute[OnQueryFinish(s)] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`Drzava` =0, `Godine` =0, `Spol` =0' at line 1
eto ga

NaÄ'i taj dio u skripti i daj nam
I molim te koristi kod (code) kod (/code)    samo umjesto () ide [],nepregledno je ovako.

Citat: Paul Castellano poslato Avgust 12, 2018, 23:50:01 POSLE PODNE
NaÄ'i taj dio u skripti i daj nam
I molim te koristi kod (code) kod (/code)    samo umjesto () ide [],nepregledno je ovako.
mysql_format(konekcija, Query,sizeof(Query), "INSERT INTO `korisnici` (ImeKorisnika, Sifra, Novac, Level, Admin,  IP, Drzava, Godine, Spol) VALUES('%e', '%e', 5000, 1, 0, '%e','e','e','e')", RPIme(playerid), inputtext, IP, inputtext, PlayerInfo[playerid][pDrzava], PlayerInfo[playerid][pSpol]);
proud owner of Balkan Expiriance Community

probaj

mysql_format(konekcija, Query,sizeof(Query), "INSERT INTO `korisnici` (ImeKorisnika, Sifra, Novac, Level, Admin,  IP,Drzava, Godine, Spol) VALUES('%e', '%e', 5000, 1, 0, '%e','%e','%i','%i')",RPIme(playerid), inputtext,  IP, PlayerInfo[playerid][pDrzava], PlayerInfo[playerid][pGodine], PlayerInfo[playerid][pSpol]);

Citat: Paul Castellano poslato Avgust 13, 2018, 00:03:12 PRE PODNE
probaj

mysql_format(konekcija, Query,sizeof(Query), "INSERT INTO `korisnici` (ImeKorisnika, Sifra, Novac, Level, Admin,  IP,Drzava, Godine, Spol) VALUES('%e', '%e', 5000, 1, 0, '%e','%e','%i','%i')",RPIme(playerid), inputtext,  IP, PlayerInfo[playerid][pDrzava], PlayerInfo[playerid][pGodine], PlayerInfo[playerid][pSpol]);

[00:04:54] [WARNING] cache_get_row_count - no active cache
[00:05:14] [ERROR] CMySQLQuery::Execute[OnQueryFinish(s)] - (error #1054) Unknown column 'Kiconyyy_Brataaa' in 'field list'
[00:05:18] [ERROR] CMySQLQuery::Execute[OnQueryFinish(s)] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`Drzava` =66, `Godine` =0, `Spol` =73' at line 1
proud owner of Balkan Expiriance Community

mysql_format(konekcija, Query,sizeof(Query), "INSERT INTO `korisnici` (ImeKorisnika, Sifra, Novac, Level, Admin,  IP,Drzava, Godine, Spol) VALUES('%e', '%e', '5000', '1', '0', '%e','%i','%i','%i')",RPIme(playerid), inputtext,  IP, PlayerInfo[playerid][pDrzava], PlayerInfo[playerid][pGodine], PlayerInfo[playerid][pSpol]);

Citat: Paul Castellano poslato Avgust 13, 2018, 00:13:18 PRE PODNE
mysql_format(konekcija, Query,sizeof(Query), "INSERT INTO `korisnici` (ImeKorisnika, Sifra, Novac, Level, Admin,  IP,Drzava, Godine, Spol) VALUES('%e', '%e', '5000', '1', '0', '%e','%i','%i','%i')",RPIme(playerid), inputtext,  IP, PlayerInfo[playerid][pDrzava], PlayerInfo[playerid][pGodine], PlayerInfo[playerid][pSpol]);

[00:15:33] [WARNING] cache_get_row_count - no active cache
[00:15:56] [ERROR] CMySQLQuery::Execute[OnQueryFinish(s)] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`Drzava` =66, `Godine` =0, `Spol` =73' at line 1
proud owner of Balkan Expiriance Community