Pretraga

Pritisnite Enter za pretragu ili Escape za zatvaranje

Problem oko sacuvavanja drzava,spol,godina u mysql

Započeo Kicony
pre 7 godina
2,040
pregleda
9
postova
Kicony
Rookie
pre 7 godina
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 = god;
new gstring;
          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, inputtext );
  SelectTextDraw( playerid, 0xAA3333AA );
}
return 1;
}
case 2:
{
  if(!response) SetTimerEx("kick",1000,false,"d",playerid);
    if(response)
    {
        switch(listitem)
        {
              case 0:
            {
                PlayerInfo = 0;
strmid( PlayerInfo[ playerid ][ pDrzava ], inputtext, 0, strlen( inputtext ), 34 );
PlayerTextDrawSetString( playerid, RegisterTD, inputtext );
SelectTextDraw( playerid, 0xAA3333AA );
return 1;
}
case 1:
            {
                PlayerInfo = 1;
                strmid( PlayerInfo[ playerid ][ pDrzava ], inputtext, 0, strlen( inputtext ), 34 );
PlayerTextDrawSetString( playerid, RegisterTD, inputtext );
SelectTextDraw( playerid, 0xAA3333AA );
return 1;
}
case 2:
            {
                PlayerInfo = 2;
                strmid( PlayerInfo[ playerid ][ pDrzava ], inputtext, 0, strlen( inputtext ), 34 );
PlayerTextDrawSetString( playerid, RegisterTD, 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,stxt;
                PlayerInfo = 1;
                if(PlayerInfo == 0) { dtxt = "Hrvatska";
}else if(PlayerInfo == 1) { dtxt = "Srbija";
                        }else if(PlayerInfo == 2) { dtxt = "BIH"; }
                        if(PlayerInfo == 1) { stxt = "Musko";
}else if(PlayerInfo == 2) { stxt = "Zensko"; }
strmid( PlayerInfo[ playerid ][ pSpol ], inputtext, 0, strlen( inputtext ), 34 );
PlayerTextDrawSetString( playerid, RegisterTD, inputtext );
  SelectTextDraw( playerid, 0xAA3333AA );
return 1;
}
case 1:
{
    new dtxt,stxt;
    PlayerInfo = 2;
    if(PlayerInfo == 0) { dtxt = "Hrvatska";
}else if(PlayerInfo == 1) { dtxt = "Srbija";
                        }else if(PlayerInfo == 2) { dtxt = "BIH"; }
                        if(PlayerInfo == 1) { stxt = "Musko";
}else if(PlayerInfo == 2) { stxt = "Zensko"; }
strmid( PlayerInfo[ playerid ][ pSpol ], inputtext, 0, strlen( inputtext ), 34 );
PlayerTextDrawSetString( playerid, RegisterTD, inputtext );
        SelectTextDraw( playerid, 0xAA3333AA );
        return 1;
}
}
}
    return 1;
}
case 4:
{
    new IP;
    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, PlayerInfo);
            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, inputtext );
        SelectTextDraw( playerid, 0xAA3333AA );
}
}
        case 6:
{
          mysql_store_result();
if(mysql_num_rows(konekcija) != 1)
{
}
mysql_free_result();
PlayerTextDrawSetString( playerid, RegisterTD, inputtext );
        SelectTextDraw( playerid, 0xAA3333AA );
}
}
if(dialogid == 7)
{
    if(!response) return Kick(playerid);
    if(response)
    {
SpawnPlayer(playerid);
    }
}
if(dialogid == 😎
{
    new string;
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;
}
Nikola-.-
Kingpin
pre 7 godina
Mrzi me da citam ovo, daj mysql_log
Kicony
Rookie
pre 7 godina
[15:15:55] 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] 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
Adam_Lay
Underboss
4
pre 7 godina
Kicony wrote on August 12, 2018, 9:46 pm:
[15:15:55] 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] 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.
Kicony
Rookie
pre 7 godina
Paul Castellano wrote on August 12, 2018, 9:50 pm:
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, PlayerInfo);
Adam_Lay
Underboss
4
pre 7 godina
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, PlayerInfo, PlayerInfo);
Kicony
Rookie
pre 7 godina
Paul Castellano wrote on August 12, 2018, 10:03 pm:
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, PlayerInfo, PlayerInfo);
[00:04:54] cache_get_row_count - no active cache
[00:05:14] CMySQLQuery::Execute[OnQueryFinish(s)] - (error #1054) Unknown column 'Kiconyyy_Brataaa' in 'field list'
[00:05:18] 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
Adam_Lay
Underboss
4
pre 7 godina
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, PlayerInfo, PlayerInfo);
Kicony
Rookie
pre 7 godina
Paul Castellano wrote on August 12, 2018, 10:13 pm:
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, PlayerInfo, PlayerInfo);
[00:15:33] cache_get_row_count - no active cache
[00:15:56] 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

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava