[15:35:02] ====================================================================
[15:35:02] Error ID: 1064, Error: 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 ''yhy36XXXX8B5z6zWAM3b536tOTwh35L98i4EA4544ytXT7W3lEqJ22i19kBE3334CE63' at line 1
[15:35:02] Callback:
[15:35:02] gQuery: INSERT INTO `mybb_users` (`uid`,`username`,`password`,`salt`,`loginkey`) VALUES ('2','Youssef','BE3334CE634XXXXBC9C07E58EC9FE47E','yhy36XXXX8B5z6zWAM3b536tOTwh35L98i4EA4544ytXT7W3lEqJ22i19kBE3334CE63
[15:35:02] ====================================================================
|
yhy36XXXX8B5z6zWAM3b536tOTwh35L98i4EA4544ytXT7W3lE qJ22i19kBE3334CE63 |
|
and is more than the 50 caracters that i generated!!
** ok i'll remake the code and reply again if it didn't work |

#include <a_samp>
#include <md5>
stock randomSalted(strDest[], strLen = 8)
{
while(strLen--)
strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0');
}
stock randomKey(strDest[], strLen = 50)
{
while(strLen--)
strDest[strLen] = random(2) ? (random(26) + (random(2) ? 'a' : 'A')) : (random(10) + '0');
}
stock HashMyBBPassword(string[], salt[])
{
new string2[96];
format(string2, sizeof(string2), "%s%s", MD5_Hash(salt), MD5_Hash(string));
for(new i=0; i < sizeof(string2); i++)
{
string2[i] = tolower(string2[i]);
}
string2 = MD5_Hash(string2);
return string2;
}
main()
{
new salted[8], loginkey[50], mybb[128], password[30];
format(password, sizeof(password), "thepassword"); // just to set a password to salt
randomSalted(salted, 8);
randomKey(loginkey, 50);
print(loginkey);
print(salted);
format(mybb, sizeof(mybb), "%s", HashMyBBPassword(password, salted));
print(mybb);
}
