[AJUDA] MySQL erro, ajuda aqui !!! (HURGENTE)
#1

fiz uma gambiarra, nгo sei se funciona mas la vai...
pawn Код:
new string[256], level[256];
    format(string, sizeof string, "ladmin/users/Ranny.sav");

    level=dini_Get(string,"level");

format(query, sizeof( query ),"insert `combinations`.`game_sessions`(`nome`,level) values ('Ranny', '%s')",level);
print("Conta Criada no SQL");
samp_mysql_query(query);
pawn Код:
new pname[MAX_PLAYERS],string[256];
    new password_hash[256], ip[256], registered[256], RegisteredDate[256], loggedin[256], language[256], banned[256],\
    level[256], LastOn[256], money[256], kills[256], deaths[256], hours[256], minutes[256], seconds[256], score[256],\
x1[256], y1[256], z1[256], interior1[256], weap1[256], weap1ammo[256], weap2[256], weap2ammo[256], weap3[256], weap3ammo[256],\
weap4[256], weap4ammo[256], weap5[256], weap5ammo[256], weap6[256], weap6ammo[256], health[256], armour[256], TimesOnServer[256];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(string, sizeof string, "ladmin/users/Ranny.sav");

password_hash =   dini_Get(string,"password_hash");
ip =        dini_Get(string,"ip");
registered =    dini_Get(string,"registered");
RegisteredDate =  dini_Get(string,"RegisteredDate");
loggedin =     dini_Get(string,"loggedin");
language =     dini_Get(string,"language");
banned =      dini_Get(string,"banned");
level =       dini_Get(string,"level");
LastOn =      dini_Get(string,"LastOn");
money =       dini_Get(string,"money");
kills =       dini_Get(string,"kills");
deaths =      dini_Get(string,"deaths");
hours =       dini_Get(string,"hours");
minutes =      dini_Get(string,"minutes");
seconds =      dini_Get(string,"seconds");
score =       dini_Get(string,"score");
x1 =        dini_Get(string,"x1");
y1 =        dini_Get(string,"y1");
z1 =        dini_Get(string,"z1");
interior1 =     dini_Get(string,"interior1");
weap1 =       dini_Get(string,"weap1");
weap1ammo =     dini_Get(string,"weap1ammo");
weap2 =       dini_Get(string,"weap2");
weap2ammo =     dini_Get(string,"weap2ammo");
weap3 =       dini_Get(string,"weap3");
weap3ammo =     dini_Get(string,"weap3ammo");
weap4 =       dini_Get(string,"weap4");
weap4ammo =     dini_Get(string,"weap4ammo");
weap5 =       dini_Get(string,"weap5");
weap5ammo =     dini_Get(string,"weap5ammo");
weap6 =       dini_Get(string,"weap6");
weap6ammo =     dini_Get(string,"weap6ammo");
health =      dini_Get(string,"health");
armour =      dini_Get(string,"armour");
TimesOnServer =   dini_Get(string,"TimesOnServer");

    new query[256];
format(query, sizeof( query ),"insert into `combinations`.`game_sessions`(`nome`, `password_hash`, `ip`, `registered`, `RegisteredDate`, `loggedin`) values ('%s','%s','%s','%s','%s','%s')",pname, password_hash, ip, registered, RegisteredDate, loggedin);
format(query, sizeof( query ),"insert into `combinations`.`game_sessions`(`language` , `banned`, `level`, `LastOn`, `money`, `kills` values ('%s','%s','%s','%s','%s','%s')", language, banned, level, LastOn, money, kills);
format(query, sizeof( query ),"insert into `combinations`.`game_sessions`(`deaths`, `hours`, `minutes`, `seconds`, `score`, `x1` values ('%s','%s','%s','%s','%s','%s')", deaths, hours, minutes, seconds, score,x1);
format(query, sizeof( query ),"insert into `combinations`.`game_sessions`(`y1`, `z1`, `interior1`, `weap1`, `weap1ammo`,    `weap2` values ('%s','%s','%s','%s','%s','%s')", y1, z1, interior1, weap1, weap1ammo, weap2);
format(query, sizeof( query ),"insert into `combinations`.`game_sessions`(`weap2ammo`, `weap3`, `weap3ammo`, `weap4`, `weap4ammo`, `weap5` values ('%s','%s','%s','%s','%s','%s')",weap2ammo, weap3, weap3ammo, weap4, weap4ammo, weap5);
format(query, sizeof( query ),"insert into `combinations`.`game_sessions`(`weap5ammo`, `weap6`, `weap6ammo`, `health`, `armour`, `TimesOnServer` values ('%s','%s','%s','%s','%s','%s')",weap5ammo, weap6, weap6ammo, health, armour, TimesOnServer);
print("Conta Criada no SQL");
mysql_query(query);
pawn Код:
new pname[MAX_PLAYERS],string[500];
    new password_hash[256], ip[256], registered[256], RegisteredDate[256], loggedin[256], language[256], banned[256],\
    level[256], LastOn[256], money[256], kills[256], deaths[256], hours[256], minutes[256], seconds[256], score[256],\
x1[256], y1[256], z1[256], interior1[256], weap1[256], weap1ammo[256], weap2[256], weap2ammo[256], weap3[256], weap3ammo[256],\
weap4[256], weap4ammo[256], weap5[256], weap5ammo[256], weap6[256], weap6ammo[256], health[256], armour[256], TimesOnServer[256];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(string, sizeof string, "ladmin/users/%s.sav", pname);

password_hash =   dini_Get(string," password_hash ");
ip =        dini_Get(string," ip ");
registered =    dini_Get(string," registered ");
RegisteredDate =  dini_Get(string," RegisteredDate ");
loggedin =     dini_Get(string," loggedin ");
language =     dini_Get(string," language ");
banned =      dini_Get(string," banned ");
level =       dini_Get(string," level ");
LastOn =      dini_Get(string," LastOn ");
money =       dini_Get(string," money ");
kills =       dini_Get(string," kills ");
deaths =      dini_Get(string," deaths ");
hours =       dini_Get(string," hours ");
minutes =      dini_Get(string," minutes ");
seconds =      dini_Get(string," seconds ");
score =       dini_Get(string," score ");
x1 =        dini_Get(string," x1 ");
y1 =        dini_Get(string," y1 ");
z1 =        dini_Get(string," z1 ");
interior1 =     dini_Get(string," interior1 ");
weap1 =       dini_Get(string," weap1 ");
weap1ammo =     dini_Get(string," weap1ammo ");
weap2 =       dini_Get(string," weap2 ");
weap2ammo =     dini_Get(string," weap2ammo ");
weap3 =       dini_Get(string," weap3 ");
weap3ammo =     dini_Get(string," weap3ammo ");
weap4 =       dini_Get(string," weap4 ");
weap4ammo =     dini_Get(string," weap4ammo ");
weap5 =       dini_Get(string," weap5 ");
weap5ammo =     dini_Get(string," weap5ammo ");
weap6 =       dini_Get(string," weap6 ");
weap6ammo =     dini_Get(string," weap6ammo ");
health =      dini_Get(string," health ");
armour =      dini_Get(string," armour ");
TimesOnServer =   dini_Get(string," TimesOnServer ");
print("Conta Criada no SQL");
    new query[1000];
    format(query, sizeof( query ),"UPDATE `combinations`.`game_sessions` SET ( `nome`
    `password_hash`, `ip`, `registered`, `RegisteredDate`, `loggedin` , `language` ,
    `banned`, `level`, `LastOn`, `money`, `kills`, `deaths`, `hours`, `minutes`,
    `seconds`, `score`, `x1`, `y1`, `z1`, `interior1`, `weap1`, `weap1ammo`,
    `weap2`, `weap2ammo`, `weap3`, `weap3ammo`, `weap4`, `weap4ammo`, `weap5`,
    `weap5ammo`, `weap6`, `weap6ammo`, `health`, `armour`, `TimesOnServer`)
    values ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',
    '%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s',
    '%s','%s','%s','%s','%s','%s','%s')"
,pname, password_hash, ip, registered, RegisteredDate, loggedin, language, banned,
    level, LastOn, money, kills, deaths, hours, minutes, seconds, score,
    x1, y1, z1, interior1, weap1, weap1ammo, weap2, weap2ammo, weap3, weap3ammo,
    weap4, weap4ammo, weap5, weap5ammo, weap6, weap6ammo, health, armour, TimesOnServer);
    mysql_query( query );

    return 1;
}
Isso ta me dechando doido mesmo... Agora sу resta a ajuda de vocкs.
Reply
#2

Ajuda? n consigo ler o arquivo e mandar pro SQL.
Reply
#3

Pergunta, esse game mode nгo й seu nй? Nem codigo....
Код:
combinations
eh o Deadly COmbinations neh? ._.
Reply
#4

Quote:
Originally Posted by Chuck_Cornfild
Pergunta, esse game mode nгo й seu nй? Nem codigo....
Код:
combinations
eh o Deadly COmbinations neh? ._.
Esse й o meu sim, quero fazer um sistema novo to criando um sitesinho basico pra vender armas mas isso ai interfere muito. (Eu tenho esse gm sim usei ele pra ver como й feito as funзoes =) mas eu nem louco vou dechar de fazer meu gm ou editar um).
Alguem ai entende porque nгo esta funcionando? deveria emviar para uma tabela SQL mas nгo envia, pelo almenos se podesse enviar ate 4 valores... mas nгo envia.

Seria melhor pegar direto pelo php? sem mysql?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)