13.11.2016, 16:33
Hi guys.
I made sign up system, and last insert into base doesn't work. MySQL_Format function doesn't work, but format function Works. I must use MySQL_Format function because I have data for %e :S
Code is below
Log says
I made sign up system, and last insert into base doesn't work. MySQL_Format function doesn't work, but format function Works. I must use MySQL_Format function because I have data for %e :S
Code is below
Код:
stock _HRP_RegistrirajKorisnika(_playerid) { new _tick = GetTickCount(); if(_HRP_postavke{2} == 1 || _HRP_postavke{2} == 2 || _HRP_postavke{2} == 5 || _HRP_postavke{2} == 6) { new _upit[464]; new Cache:_kes; new _vrijeme = gettime(); mysql_format(_HRP_baza, _upit, 96, "SELECT ID FROM "_HRP_MYSQL_KORISNICI" WHERE Mail='%e'", _HRP_Korisnik[_playerid][_kMail]); _kes = mysql_query(_HRP_baza, _upit, true); if(!cache_num_rows()) { cache_delete(_kes); mysql_format(_HRP_baza, _upit, 128, "INSERT INTO "_HRP_MYSQL_REGISTRACIJE" (Ime,GPCI,IP,Vrijeme)VALUES('%e','%s','%s',%d)", _HRP_Ime(_playerid), _HRP_GPCI(_playerid), _HRP_IP(_playerid), _vrijeme); mysql_query(_HRP_baza, _upit); mysql_format(_HRP_baza, _upit, 86, "SELECT ID FROM "_HRP_MYSQL_REGISTRACIJE" WHERE Ime='%e'", _HRP_Ime(_playerid)); // FRIST _kes = mysql_query(_HRP_baza, _upit, true); if(cache_num_rows()) { cache_get_value_name_int(0, "ID", _HRP_Korisnik[_playerid][_kID]); cache_delete(_kes); new _registriran = 2; if(Bit2_Get(_HRP_kRegistriran, _playerid) == 2) { if(_HRP_postavke{2} == 2 || _HRP_postavke{2} == 6) _registriran = 0; } else { if(_HRP_postavke{2} == 1 || _HRP_postavke{2} == 5) _registriran = 1; else _registriran = 3; Bit16_Set(_HRP_khEX, _playerid, 5); } SHA256_PassHash(_HRP_RegZaporka[_playerid], ""_HRP_SALT"", _HRP_Korisnik[_playerid][_kZaporka], 65); WP_Hash(_HRP_Korisnik[_playerid][_kZaporka], 129, _HRP_Korisnik[_playerid][_kZaporka]); format(_upit, 35, // JOK, OVO NE SMIJEЉ VIDJETI ;); SHA256_PassHash(_upit, ""_HRP_SALT"", _upit, 65); WP_Hash(_upit, 129, _upit); printf("token - %s", _upit); // SECOND mysql_format(_HRP_baza, _upit, 464, "INSERT INTO "_HRP_MYSQL_KORISNICI" (Ime,ID,Registriran,Zaporka,Token,IP,GPCI,Mail,`hEx`,Spol,Rasa,Godine,Skin,MailNotf,Visina,OMasa,MMasa,MSala,Zeludac,Metabolizam,H2O,Opijanje,Drogiranje,Udarac,Rast)VALUES('%e',%d,%d,'%e','%e','%e','%e','%e',%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)", _HRP_Ime(_playerid), _HRP_ID(_playerid), _registriran, _HRP_Korisnik[_playerid][_kZaporka], _upit, _HRP_IP(_playerid), _HRP_GPCI(_playerid), _HRP_Korisnik[_playerid][_kMail], Bit16_Get(_HRP_khEX, _playerid), Bit1_Get(_HRP_kSpol, _playerid), Bit2_Get(_HRP_kRasa, _playerid), _HRP_kGodine{_playerid}, Bit16_Get(_HRP_kIzgled, _playerid), Bit1_Get(_HRP_kMailNotf, _playerid), _HRP_kVisina{_playerid}, _HRP_kOMasa{_playerid}, _HRP_kMMasa{_playerid}, _HRP_kMSala{_playerid}, Bit16_Get(_HRP_kZeludac, _playerid), _HRP_kMetabolizam{_playerid}, _HRP_kH2O{_playerid}, _HRP_kOpijanje{_playerid}, _HRP_kDrogiranje{_playerid}, Bit4_Get(_HRP_kUdarac, _playerid), Bit4_Get(_HRP_kRast, _playerid)); // THIRD printf("%s - %d", _upit, strlen(_upit)); // HERE IT SHOULD PRINT FORMATTED QUERY. INSTEAD THIS QUERY, IT PRINTS OTHER QUERY(MARKED AS "FRIST") mysql_query(_HRP_baza, _upit); // ....
Quote:
[15:47:37] token - 571F23033354166F155CE4A3E937BDB2209014CAD7AE7F6B7E A69BF1C3E3CBF71565485E21209F6CD19E4632F81162C5DAFC F559EA412190EC8EF3EEC82AAB0A [15:47:37] SELECT ID FROM /* TABLE NAME */ WHERE Ime='Hondo_Harrelson' - 55 |